Prev: 8464 Up: Map Next: 84AB
8492: Start the search for targets
Sets up the table (objects or rooms) in which the target will be searched for (84BD), according to bits 2-3 of B60E, and saves the starting position in $833F. Does nothing when repeating an ALL command.
8492 LD A,($B60C) Is an ALL command already partway through its list of objects?
8495 AND A
8496 RET NZ Yes: do not restart the search - carry straight on from where it was
This entry point is used by the routine at 84E6.
8497 LD A,($B60E) A = the action's second set of flags
849A RRCA Shift its "which table" bits down...
849B RRCA
849C CALL $84BD ...and choose the object index, or the character-only/object-only index, accordingly
849F LD A,($B5EF) Is the target actually meant to be a room?
84A2 AND A
84A3 CALL NZ,$9DDE If so, search the actor's own room's exits instead of the object table
84A6 LD ($833F),IX Remember where the search has got to
84AA RET
Prev: 8464 Up: Map Next: 84AB