Prev: 53309 Up: Map Next: 53333
53317: Set zero flag if room B has an entry in pathfinding data table, otherwise reset
Used by the routine at 53194.
Input
HL Address of end of pathfinding data table
B Index of room to check table for
Output
F Zero flag set if room B is already stored in pathfinding data table, reset otherwise
53317 PUSH HL Store HL (address of end of pathfinding data table)
53318 DEC HL Move HL back to previous entry's room index...
53319 LD A,(HL) ...load into A...
53320 CP 255 ...and if this is 255 (start marker, so room B not found)...
53322 JR Z,53330 ...then skip ahead to 53330
53324 DEC HL Move HL back to entry's direction index
53325 CP B If room to search for not the same as current entry's room...
53326 JR NZ,53318 ...then loop back to 53318 to test next entry
At this point, the room we're looking for (in B) is already stored in the pathfinding data table and the zero flag is set.
53328 POP HL Restore HL (address of end of pathfinding data table)
53329 RET Return
53330 POP HL Restore HL (address of end of pathfinding data table)
53331 DEC A Reset zero flag
53332 RET Return
Prev: 53309 Up: Map Next: 53333