Prev: 46565 Up: Map Next: 46589
46572: Check Active Scenic Events
Used by the routines at FindActiveScenicEvent and Handler_ChangeRoom.
Check Active Scenic Events.
Input
HL Pointer to scenic data
Output
A The listed item that is here, or 255 if there is none
F The zero flag is set when an item on the list is here or carried
CheckActiveScenicEvents 46572 JR CheckActiveScenicEvents_Next Check the first scenic item at CheckActiveScenicEvents_Next.
CheckActiveScenicEvents_Loop 46574 INC HL Advance HL to the next byte.
CheckActiveScenicEvents_Next 46575 LD A,(HL) Read the next scenic item.
46576 CP 255 Stop at the end of the scenic list.
46578 JR Z,Check_ActiveScenicEvents_Done
46580 CALL Get_ObjectLocation Call Get_ObjectLocation to find where the object is.
46583 JR NZ,CheckActiveScenicEvents_Loop Try the next entry when this one is not here or carried.
46585 LD A,(HL) Return the scenic item that is here.
46586 RET
Check_ActiveScenicEvents_Done 46587 AND A Clear the zero flag (A holds the 255 end marker) to report that nothing on the list is here.
46588 RET Return.
View the equivalent code in;
Prev: 46565 Up: Map Next: 46589