Prev: 44588 Up: Map Next: 44669
44638: Handler: Is Carrying Item
Rejects a drop when the item is not carried. Plural items listed in Table_PluralItems use the "them" wording.
Input
A Item ID
Output
A 0 when the item is carried, otherwise 1
F The zero flag is set when the item is carried
The drop is valid when the item is already being carried.
Handler_IsCarryingItem 44638 CALL CheckObjectInInventory Call CheckObjectInInventory to test whether the item is carried.
44641 RET Z Return if the item is carried.
Tell the player the item is not carried. Prefer the plural form from Table_PluralItems when the item is one of those three.
44642 LD HL,29 Point HL at the singular "not carrying" message Messaging_YoureNotCarryingIt.
44645 LD BC,3 Load BC with the plural-list length 0003.
44648 XOR A
44649 OR C
44650 JR Z,IsCarryingItem_PrintReject Jump to IsCarryingItem_PrintReject when the plural list length is zero.
44652 PUSH HL Stash the message pointer on the stack.
44653 LD HL,46833 Point HL at the plural items table at Table_PluralItems.
44656 CPIR Search Table_PluralItems for the item ID.
44658 POP HL Restore the message pointer from the stack.
44659 JR NZ,IsCarryingItem_PrintReject Jump to IsCarryingItem_PrintReject when this item is singular.
44661 INC HL Move HL on to the plural message.
Print the rejection message and return failure.
IsCarryingItem_PrintReject 44662 CALL PrintCompressedStringAndNewline Call PrintCompressedStringAndNewline to print that compressed string and a newline.
44665 LD A,1 Load 1 into A and clear the zero flag; the drop is rejected.
44667 AND A
44668 RET Return.
Prev: 44588 Up: Map Next: 44669