Prev: 31721 Up: Map Next: 31823
31759: BuildExitList
Builds the current room's door-exit list (CorridorPosTable + 2): walks the room's 5 direction slots in RoomAdjCorridors and stores each destination that differs from the current room (up to 5 entries). The room view draws one door per entry.
31759 LD A,(31242) A = current room
31762 LD L,A
31763 LD H,0
31765 PUSH HL
31766 ADD HL,HL
31767 ADD HL,HL
31768 POP DE
31769 ADD HL,DE
31770 LD DE,29171
31773 ADD HL,DE
31774 LD DE,29632
31777 LD B,5
31779 LD C,(HL)
31780 CP C
31781 JR Z,31792
31783 LD A,(31242)
31786 CP C
31787 JR Z,31792
31789 LD A,C
31790 LD (DE),A
31791 INC DE
31792 INC HL
31793 DJNZ 31779
31795 RET
BuildRoomItemList: list the item ids lying in the current room — scan ItemLocations (29940) from the top down for entries equal to the room number, appending each match to RoomItemList (29962).
31796 LD A,(31242) C = current room
31799 LD C,A
31800 LD HL,29961 scan ItemLocations from item 21 down
31803 LD DE,29962 DE -> RoomItemList write pointer
31806 LD B,22
31808 LD A,(HL) item's location
31809 CP C lying in this room?
31810 JR NZ,31816
31812 LD A,B yes: append its id (= B-1) to the list
31813 DEC A
31814 LD (DE),A
31815 INC DE
31816 DEC HL
31817 DJNZ 31808
31819 RET
This entry point is used by the routines at 35451, 35578 and 44880. RefreshHeldItems: find what the current actor (31241) holds.
31820 LD A,(31241)
Prev: 31721 Up: Map Next: 31823