Prev: 9C78 Up: Map Next: 9C9F
9C8A: Condition: Test The Object Is Held
Used by the routine at ConditionIsTheObjectCarried.
Returns with carry set when the character whose turn it is holds the object, either directly or inside something the character holds. Otherwise returns with carry clear.
Find the object's record.
Condition_TestTheObjectIsHeld 9C8A CALL LocateObject Call LocateObject to locate object.
9C8D PUSH AF Read where this object is from the object record.
9C8E LD A,(IX+$01)
9C91 CP $FF Jump to Condition_TestTheObjectIsHeld_NotInside if this object is not inside another object.
9C93 JR Z,Condition_TestTheObjectIsHeld_NotInside
9C95 POP IX Jump back to Condition_TestTheObjectIsHeld if where this object is is not the character whose turn it is.
9C97 CP (HL)
9C98 JR NZ,Condition_TestTheObjectIsHeld
9C9A SCF Return with carry set: this character is carrying it.
9C9B RET Return.
Condition_TestTheObjectIsHeld_NotInside 9C9C POP AF See whether where this object is is zero.
9C9D AND A
9C9E RET Return.
View the equivalent code in;
Prev: 9C78 Up: Map Next: 9C9F