Prev: 32385 Up: Map Next: 32536
32498: FindRoomMates
Scan ActorRecords' +1 room bytes for other actors in the current room, storing the first two slot numbers found into RoomMateA/RoomMateB (31250/31251).
32498 LD HL,29575 HL -> slot 1's +1 (room) byte
32501 LD DE,31250 DE -> RoomMateA
32504 LD BC,1793 B = 7 slots, C = slot number 1
32507 LD A,(31241) A' = the selected actor (excluded)
32510 EX AF,AF'
32511 LD A,(31242) A = the viewed room
32514 CP (HL) same room?
32515 JR NZ,32526
32517 EX AF,AF' and not the selected actor itself?
32518 CP C
32519 JR Z,32525
32521 EX DE,HL store the slot number
32522 LD (HL),C
32523 EX DE,HL
32524 INC DE
32525 EX AF,AF'
32526 PUSH DE next 8-byte record
32527 LD DE,8
32530 ADD HL,DE
32531 POP DE
32532 INC C
32533 DJNZ 32514
32535 RET
Prev: 32385 Up: Map Next: 32536