Fix Zora Mask swim bug

This commit is contained in:
scawful
2023-05-11 14:25:44 -05:00
parent 905dab92b4
commit 41a299bf77

View File

@@ -12,9 +12,6 @@ org $0998FC
org $07A569 org $07A569
LinkItem_ZoraMask: LinkItem_ZoraMask:
{ {
LDA $02B2 : CMP #$02 : BNE .equip
; JSR LinkItem_UsingZoraMask
.equip
; Check for R button held ; Check for R button held
LDA $F2 : CMP #$10 : BNE .return LDA $F2 : CMP #$10 : BNE .return
@@ -75,9 +72,15 @@ zora_palette:
org $07F93F org $07F93F
LinkState_UsingZoraMask: LinkState_UsingZoraMask:
{ {
; Check if the mask is equipped
LDA $02B2 : CMP #$02 : BNE .normal
CLC
; Check if we are in water or not ; Check if we are in water or not
LDA $5D : CMP #$04 : BEQ .swimming LDA $5D : CMP #$04 : BEQ .swimming
.normal
; Return to normal state ; Return to normal state
STZ $55 STZ $55
STZ $037B STZ $037B
@@ -87,7 +90,7 @@ LinkState_UsingZoraMask:
JMP .return JMP .return
.swimming .swimming
; ----------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
; Check if we are indoors or outdoors ; Check if we are indoors or outdoors
LDA $1B : BEQ .overworld ; z flag is 1 LDA $1B : BEQ .overworld ; z flag is 1
@@ -107,7 +110,7 @@ LinkState_UsingZoraMask:
JSR $E8F0 ; HandleIndoorCameraAndDoors JSR $E8F0 ; HandleIndoorCameraAndDoors
RTS RTS
; ----------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
.overworld .overworld
; Check the Y button and clear state if activated ; Check the Y button and clear state if activated