Fix powder item crash

This commit is contained in:
Kevin Cathcart
2018-09-15 09:55:49 -04:00
parent ff46a37344
commit eb4f511dc5

View File

@@ -932,7 +932,7 @@ RTL
LoadPowder: LoadPowder:
JSL.l Sprite_SpawnDynamically ; thing we wrote over JSL.l Sprite_SpawnDynamically ; thing we wrote over
%GetPossiblyEncryptedItem(WitchItem, SpriteItemValues) %GetPossiblyEncryptedItem(WitchItem, SpriteItemValues)
STA $0E80, Y ; Store item type STA $0DA0, Y ; Store item type
JSL.l PrepDynamicTile JSL.l PrepDynamicTile
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -958,12 +958,12 @@ RTL
DrawPowder: DrawPowder:
LDA $02DA : BNE .defer ; defer if link is buying a potion LDA $02DA : BNE .defer ; defer if link is buying a potion
LDA.l !REDRAW : BEQ + LDA.l !REDRAW : BEQ +
LDA $0E80, X ; Retrieve stored item type LDA $0DA0, X ; Retrieve stored item type
JSL.l PrepDynamicTile JSL.l PrepDynamicTile
LDA #$00 : STA.l !REDRAW ; reset redraw flag LDA #$00 : STA.l !REDRAW ; reset redraw flag
BRA .defer BRA .defer
+ +
LDA $0E80, X ; Retrieve stored item type LDA $0DA0, X ; Retrieve stored item type
JSL.l DrawDynamicTile JSL.l DrawDynamicTile
.defer .defer
RTL RTL
@@ -1017,7 +1017,7 @@ RTL
; CollectPowder: ; CollectPowder:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
CollectPowder: CollectPowder:
LDY $0E80, X ; Retrieve stored item type LDY $0DA0, X ; Retrieve stored item type
BNE + BNE +
; if for any reason the item value is 0 reload it, just in case ; if for any reason the item value is 0 reload it, just in case
%GetPossiblyEncryptedItem(WitchItem, SpriteItemValues) : TAY %GetPossiblyEncryptedItem(WitchItem, SpriteItemValues) : TAY