Prev: 50385 Up: Map Next: 51299
51233: Check Object Location Match
Input
A Object ID
Output
F Zero flag set if location matches
CheckObjectLocationMatch 51233 PUSH IX Stash IX and BC on the stack.
51235 PUSH BC
51236 CALL FetchObjectDataPointer Call FetchObjectDataPointer.
51239 LD B,A B=A.
51240 LD A,(41014) A=*CurrentCharacter_ID.
51243 CALL GetObjectLocation Call GetObjectLocation.
51246 CP B Jump to CheckObjectLocationMatch_2 if A is equal to B.
51247 JR Z,CheckObjectLocationMatch_2
51249 BIT 7,(IX+5) Jump to CheckObjectLocationMatch_1 if bit 7 of *IX+5 is not set.
51253 JR Z,CheckObjectLocationMatch_1
51255 LD C,A C=A.
51256 LD A,B A=B.
51257 LD B,C B=C.
51258 CALL GetObjectLocation Call GetObjectLocation.
51261 LD C,A C=A.
51262 LD A,(41014) A=*CurrentCharacter_ID.
51265 CP C Jump to CheckObjectLocationMatch_2 if A is equal to C.
51266 JR Z,CheckObjectLocationMatch_2
51268 LD A,C A=C.
51269 CP B Jump to CheckObjectLocationMatch_1 if A is not equal to B.
51270 JR NZ,CheckObjectLocationMatch_1
51272 INC A Increment A by one.
51273 JR NZ,CheckObjectLocationMatch_2 Jump to CheckObjectLocationMatch_2 if A is not equal to B.
51275 LD B,(IX+0) B=*IX+0.
51278 LD A,(40970) Jump to CheckObjectLocationMatch_2 if *CurrentCharacterAttribute is equal to *IX+15.
CheckObjectLocationMatch_0 51281 CP (IX+15)
51284 JR Z,CheckObjectLocationMatch_2
51286 INC IX Increment IX by one.
51288 DJNZ CheckObjectLocationMatch_0 Decrease counter by one and loop back to CheckObjectLocationMatch_0 until counter is zero.
CheckObjectLocationMatch_1 51290 XOR A A=0.
51291 JR CheckObjectLocationMatch_3 Jump to CheckObjectLocationMatch_3.
CheckObjectLocationMatch_2 51293 OR %00000001 Set bit 0.
CheckObjectLocationMatch_3 51295 POP BC Restore BC and IX from the stack.
51296 POP IX
51298 RET Return.
Prev: 50385 Up: Map Next: 51299