diff --git a/heartpieces.asm b/heartpieces.asm index dd9ec37..d797bff 100644 --- a/heartpieces.asm +++ b/heartpieces.asm @@ -4,12 +4,16 @@ HeartPieceGet: PHX : PHY LDY $0DA0, X ; load item value into Y register + BNE + + ; if for any reason the item value is 0 reload it, just in case + JSL.l LoadHeartPieceRoomValue : TAY + + JSL.l MaybeMarkDigSpotCollected .skipLoad STZ $02E9 ; 0 = Receiving item from an NPC or message - + CPY.b #$26 : BNE .notHeart ; don't add a 1/4 heart if it's not a heart piece LDA $7EF36B : INC A : AND.b #$03 : STA $7EF36B : BNE .unfinished_heart ; add up heart quarters BRA .giveItem @@ -35,6 +39,10 @@ HeartContainerGet: PHX : PHY JSL.l AddInventory_incrementBossSwordLong LDY $0DA0, X ; load item value into Y register + BNE + + ; if for any reason the item value is 0 reload it, just in case + JSL.l LoadHeartContainerRoomValue : TAY + + BRA HeartPieceGet_skipLoad ;-------------------------------------------------------------------------------- diff --git a/inventory.asm b/inventory.asm index 047749b..ed7e5c5 100644 --- a/inventory.asm +++ b/inventory.asm @@ -1018,6 +1018,10 @@ RTL ;-------------------------------------------------------------------------------- CollectPowder: LDY $0DA0, X ; Retrieve stored item type + BNE + + ; if for any reason the item value is 0 reload it, just in case + %GetPossiblyEncryptedItem(WitchItem, SpriteItemValues) : TAY + + STZ $02E9 ; item from NPC JSL.l Link_ReceiveItem ;JSL.l FullInventoryExternal diff --git a/npcitems.asm b/npcitems.asm index 7b20296..ff3d84d 100644 --- a/npcitems.asm +++ b/npcitems.asm @@ -156,6 +156,10 @@ ItemSet_Mushroom: PHA LDA !NPC_FLAGS_2 : ORA.b #$10 : STA !NPC_FLAGS_2 LDY $0DA0, X ; Retrieve stored item type + BNE + + ; if for any reason the item value is 0 reload it, just in case + %GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues) : TAY + + PLA ;LDY.b #$29 STZ $02E9 ; thing we wrote over - the mushroom is an npc for item purposes apparently diff --git a/tablets.asm b/tablets.asm index 5b71805..b39ec27 100644 --- a/tablets.asm +++ b/tablets.asm @@ -33,6 +33,7 @@ SpawnTabletItem: ; JSL.l HeartPieceGet ;RTL JSL.l LoadOutdoorValue + PHA JSL.l PrepDynamicTile LDA.b #$01 : STA !FORCE_HEART_SPAWN : STA !SKIP_HEART_SAVE @@ -42,6 +43,7 @@ SpawnTabletItem: STA $7FFE00 JSL Sprite_SpawnDynamically + PLA : STA $0DA0, Y ; Store item type LDA $22 : STA $0D10, Y LDA $23 : STA $0D30, Y