Prev: 31759 Up: Map Next: 31857
31823: FindHeldItems
Finds what actor A is carrying: scans ItemLocations (29940) for the slot+160 marker (front hand) into HeldItemFront (31248) and the slot+128 marker (back hand) into HeldItemBack (31249). The item id is the table position where the marker sits.
Input
Used by the routines at 37490 and 40826.
31823 ADD A,128 C = slot + 128, E = slot + 160
31825 LD C,A
31826 ADD A,32
31828 LD E,A
31829 LD HL,29961 scan ItemLocations from item 21 down
31832 LD B,22
31834 LD A,(HL)
31835 CP C back-hand marker?
31836 JR NZ,31845
31838 LD A,B yes: HeldItemBack = item id (B-1)
31839 DEC A
31840 LD (31249),A
31843 JR 31853
31845 CP E front-hand marker?
31846 JR NZ,31853
31848 LD A,B yes: HeldItemFront = item id
31849 DEC A
31850 LD (31248),A
31853 DEC HL
31854 DJNZ 31834
31856 RET
This entry point is used by the routines at 35451, 35578 and 37490.
Prev: 31759 Up: Map Next: 31857