![]() |
Routines |
Prev: AE36 | Up: Map | Next: AE80 |
|
||||||||||
ValidateItemPresent | AE6B | PUSH HL | Stash HL and DE on the stack. | |||||||
AE6C | PUSH DE | |||||||||
AE6D | LD E,A | Store the object ID in DE. | ||||||||
AE6E | LD D,$00 | |||||||||
AE70 | LD HL,$A66C | HL=Table_ItemLocations. | ||||||||
AE73 | ADD HL,DE | Add the object ID to the object/ event locations table. | ||||||||
AE74 | LD A,($A7C3) | Jump to Handler_Objects_Return if the object/ event table states that it's located in *CurrentRoom. Note also sets/ unsets the Z flag accordingly. | ||||||||
AE77 | CP (HL) | |||||||||
AE78 | JR Z,Handler_Objects_Return | |||||||||
Check the players inventory, as an object can still be used if it's being held.
|
||||||||||
AE7A | LD A,$01 | Lastly, set the Z flag if the item is in the players inventory. | ||||||||
AE7C | CP (HL) | |||||||||
Housekeeping; restore DE and HL to their previous values.
|
||||||||||
Handler_Objects_Return | AE7D | POP DE | Restore DE and HL from the stack. | |||||||
AE7E | POP HL | |||||||||
AE7F | RET | Return. |
Prev: AE36 | Up: Map | Next: AE80 |