Prev: 44849 Up: Map Next: 44886
44857: Check Room Objects
Used by the routine at Handler_RoomExits.
Input
A Room number
Output
A 0 or 1 if objects are found or not
CheckRoomObjects 44857 LD HL,42604 HL=Table_ItemLocations.
44860 LD BC,(42982) BC=*Count_Items.
CheckRoomObjects_Loop 44864 CPIR Search for the room number in the table.
44866 RET NZ Return if no objects are found.
44867 PUSH HL Stash the object location table pointer on the stack.
44868 CALL ValidateObject Call ValidateObject.
44871 POP HL Restore the object location table pointer from the stack.
44872 JR NZ,NoRoomObjectsFound Jump to NoRoomObjectsFound if there are no objects found here.
44874 LD E,A Temporarily store A in E.
44875 LD A,B Are there more objects to check?
44876 OR C
44877 LD A,E Restore the A register.
44878 JR NZ,CheckRoomObjects_Loop Jump to CheckRoomObjects_Loop if there are more objects to check.
Set the "successful" output.
44880 LD A,1 Set A to 1 to indicate that objects were found.
44882 AND A Set flags.
44883 RET Return.
Set the "failure" output.
NoRoomObjectsFound 44884 XOR A Set A to 0 to indicate that no objects were found.
44885 RET Return.
Prev: 44849 Up: Map Next: 44886