diff options
| author | dannye <33dannye@gmail.com> | 2020-11-04 00:06:44 -0600 |
|---|---|---|
| committer | dannye <33dannye@gmail.com> | 2020-11-04 00:06:44 -0600 |
| commit | 5647ca687b92954dcf37a6ea6bfbc9a341c32de4 (patch) | |
| tree | dde1937a1bfdb3a835f4155e1c2eb8f1aaf86f63 /engine/items/inventory.asm | |
| parent | Merge pull request #55 from Deokishisu/patch-1 (diff) | |
| download | pokeyellow-5647ca687b92954dcf37a6ea6bfbc9a341c32de4.tar.gz pokeyellow-5647ca687b92954dcf37a6ea6bfbc9a341c32de4.tar.xz pokeyellow-5647ca687b92954dcf37a6ea6bfbc9a341c32de4.zip | |
Sync with pokered
Diffstat (limited to 'engine/items/inventory.asm')
| -rw-r--r-- | engine/items/inventory.asm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/engine/items/inventory.asm b/engine/items/inventory.asm index 58bcf7e9..c2e0b2b4 100644 --- a/engine/items/inventory.asm +++ b/engine/items/inventory.asm @@ -4,7 +4,7 @@ ; [wcf91] = item ID ; [wItemQuantity] = item quantity ; sets carry flag if successful, unsets carry flag if unsuccessful -AddItemToInventory_: +AddItemToInventory_:: ld a, [wItemQuantity] ; a = item quantity push af push bc @@ -12,10 +12,10 @@ AddItemToInventory_: push hl push hl ld d, PC_ITEM_CAPACITY ; how many items the PC can hold - ld a, wNumBagItems & $FF + ld a, LOW(wNumBagItems) cp l jr nz, .checkIfInventoryFull - ld a, wNumBagItems >> 8 + ld a, HIGH(wNumBagItems) cp h jr nz, .checkIfInventoryFull ; if the destination is the bag @@ -98,7 +98,7 @@ AddItemToInventory_: ; hl = address of inventory (either wNumBagItems or wNumBoxItems) ; [wWhichPokemon] = index (within the inventory) of the item to remove ; [wItemQuantity] = quantity to remove -RemoveItemFromInventory_: +RemoveItemFromInventory_:: push hl inc hl ld a, [wWhichPokemon] ; index (within the inventory) of the item being removed |
