diff options
Diffstat (limited to 'engine/events/hidden_items.asm')
-rw-r--r-- | engine/events/hidden_items.asm | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/engine/events/hidden_items.asm b/engine/events/hidden_items.asm index 97bb0b71..63b95bcf 100644 --- a/engine/events/hidden_items.asm +++ b/engine/events/hidden_items.asm @@ -9,7 +9,7 @@ HiddenItems: predef FlagActionPredef ld a, c and a - ret nz + jr nz, .itemAlreadyFound call EnableAutoTextBoxDrawing ld a, 1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a @@ -18,6 +18,11 @@ HiddenItems: call GetItemName tx_pre_jump FoundHiddenItemText +.itemAlreadyFound + ld a, $ff + ldh [hItemAlreadyFound], a + ret + INCLUDE "data/events/hidden_item_coords.asm" FoundHiddenItemText:: @@ -54,7 +59,7 @@ HiddenCoins: predef GetQuantityOfItemInBag ld a, b and a - ret z + jr z, .doNotPickUpCoins ld hl, HiddenCoinCoords call FindHiddenItemOrCoinsIndex ld [wHiddenItemOrCoinsIndex], a @@ -65,7 +70,7 @@ HiddenCoins: predef FlagActionPredef ld a, c and a - ret nz + jr nz, .doNotPickUpCoins xor a ldh [hUnusedCoinsByte], a ldh [hCoins], a @@ -79,6 +84,12 @@ HiddenCoins: cp 40 jr z, .bcd20 ; should be bcd40 jr .bcd100 + +.doNotPickUpCoins + ld a, $ff + ldh [hItemAlreadyFound], a + ret + .bcd10 ld a, $10 ldh [hCoins + 1], a |