Prev: 8F37 Up: Map Next: 8F5F
8F40: FOLLOW
If the character being followed is in the same room, nothing happens: 'I cannot follow X from here.' Otherwise the actor looks for an exit from the current room that leads straight to the room the character is in (9E76) and takes it (8EA0). So you can only follow someone who has just left by a direct exit.
8F40 LD IX,($B5FC) IX = the actor's own record
8F44 LD B,(IX+$10) B = the actor's own room
8F47 LD IX,($B5F8) IX = the target character's own record
8F4B LD A,(IX+$10) Is the target actually in the same room as the actor?
8F4E CP B
8F4F JR Z,$8F59 Yes: there is nowhere to follow them to (below)
8F51 CALL $9E76 No: find the exit that leads straight to where they are
8F54 CP $FF
8F56 JP NZ,$8EA0 Found one: go through it
8F59 LD HL,$AEDB No direct exit (or they are right here): "I cannot follow X from here."
8F5C JP $72D4
Prev: 8F37 Up: Map Next: 8F5F