Fix buffered sword issue when transitioning to water with sword out

This commit is contained in:
codemann8
2026-01-29 21:26:19 -06:00
parent c438e9fc3c
commit bf2bd1974d
2 changed files with 5 additions and 0 deletions

View File

@@ -1338,6 +1338,7 @@ OWWorldTerrainUpdate: ; x = owid of destination screen, y = 1 for land to water,
STZ.w RandoOverworldForceTrans
CMP.b #$02 : BNE +
DEC : STA.w LinkDeepWater : STZ.w LinkSwimDirection
LDA.b FlagBY : AND.b #$7F : STA.b FlagBY
LDA.b #$04 : BRA .set_state
+
CMP.b #$03 : BNE ++
@@ -1358,6 +1359,7 @@ OWWorldTerrainUpdate: ; x = owid of destination screen, y = 1 for land to water,
LDA.b #$01 : STA.w LinkDeepWater
LDA.l FlippersEquipment : BEQ .no_flippers ; check if flippers obtained
LDA.b LinkState : CMP.b #$17 : BEQ .no_flippers ; check if bunny
LDA.b FlagBY : AND.b #$7F : STA.b FlagBY
LDA.b #$04 : STA.b LinkState : STZ.w LinkSwimDirection : RTS
.no_flippers
PHX

View File

@@ -65,6 +65,8 @@ LinkSubPixelVelocty = $7E002A ; Word length
LinkAnimationStep = $7E002E ;
LinkDirection = $7E002F ; $00 = Up | $02 = Down | $04 = Left | $06 = Right
;
FlagBY = $7E003A ; Bitfield for B and Y buttons.
;
OAMOffsetY = $7E0044 ;
OAMOffsetX = $7E0045 ;
LinkIncapacitatedTimer = $7E0046 ; Countdown when Link takes damage, not same as I-frames
@@ -761,6 +763,7 @@ endmacro
%assertRAM(LinkRecoilZ, $7E0029)
%assertRAM(LinkAnimationStep, $7E002E)
%assertRAM(LinkDirection, $7E002F)
%assertRAM(FlagBY, $7E003A)
%assertRAM(OAMOffsetY, $7E0044)
%assertRAM(OAMOffsetX, $7E0045)
%assertRAM(LinkIncapacitatedTimer, $7E0046)