Prev: 9CA2 Up: Map Next: 9CE9
9CCE: Check Object In Character Location
Sets the zero flag when the object in C is in the current character's location. A non-zero return means it is not.
Input
C Object ID to check
Output
F Zero flag set if object is in character's location
CheckObjectInCharacterLocation 9CCE LD IX,($A017) Read the current character record.
9CD2 LD B,(IX+$0F)
9CD5 LD A,C Call FetchObjectDataPointer to look up that object.
9CD6 CALL FetchObjectDataPointer
9CD9 LD A,(IX+$0F) Read offset 0F of the object.
9CDC CP B See whether the two values match.
9CDD RET NZ Return if they differ.
9CDE LD A,C Go to CheckObjectInCharacterLocation_Next if the object is not in this location.
9CDF CALL CheckObjectLocationMatch
9CE2 JR Z,CheckObjectInCharacterLocation_Next
9CE4 XOR A Clear A.
9CE5 RET Return.
CheckObjectInCharacterLocation_Next 9CE6 OR %00000001 Reset the zero flag.
9CE8 RET Return.
Prev: 9CA2 Up: Map Next: 9CE9