Prev: 86BC Up: Map Next: 8708
86ED: Find the next candidate target for which the action works
Calls the search routine at IY with the target's words, and for each object found, puts it in $B5D9 and tries the action (9436). Stops at the first one for which it would work.
86ED LD HL,$8333 HL = the target's own collected words (noun and adjectives)
86F0 CALL $86BA Search for the next object or room that fits them
86F3 CP $FF
86F5 RET Z None left: give up
86F6 LD ($B5D9),A Found one: it becomes the target, provisionally
86F9 LD HL,$832E
86FC SET 1,(HL) Remember that we are still searching (rather than having settled on an answer)
86FE CALL $9436 Could the action even apply to it at all?
8701 LD A,($B5EC)
8704 AND A
8705 JR Z,$86ED No: try the next candidate
8707 RET Yes: this is a workable candidate
Prev: 86BC Up: Map Next: 8708