From 9291b4e1274ee66e8a55cb5ddb3e2bb3dabe7c28 Mon Sep 17 00:00:00 2001 From: Unreference <87878910+unreference@users.noreply.github.com> Date: Fri, 15 May 2026 14:33:55 -0700 Subject: [PATCH] fix(actors): Fallback clear flag check for Big Octo platform --- .../actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/soh/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c b/soh/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c index d6f82500595..22d697dac6c 100644 --- a/soh/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c @@ -439,6 +439,17 @@ void BgBdanObjects_FallToLowerPos(BgBdanObjects* this, PlayState* play) { void BgBdanObjects_Update(Actor* thisx, PlayState* play) { BgBdanObjects* this = (BgBdanObjects*)thisx; + // https://github.com/HarbourMasters/Shipwright/issues/4339 + // Only BgBdanObjects_OctoPlatform_BattleInProgress checks Flags_GetClear, so if the platform is in any other state + // when Big Octo dies, the clear flag goes permanently unread. This fallback catches that case: the clear flag is + // only ever set by Big Octo's death, and the switch flag is only set once the platform has already begun its + // descent. + if (thisx->params == 0 && Flags_GetClear(play, thisx->room) && !Flags_GetSwitch(play, this->switchFlag)) { + Flags_SetSwitch(play, this->switchFlag); + this->dyna.actor.home.rot.y = (s16)(this->dyna.actor.shape.rot.y + 0x2000) & 0xC000; + this->actionFunc = BgBdanObjects_SinkToFloorHeight; + } + Actor_SetFocus(thisx, 50.0f); this->actionFunc(this, play); } @@ -459,4 +470,4 @@ void BgBdanObjects_Draw(Actor* thisx, PlayState* play) { } else { Gfx_DrawDListOpa(play, sDLists[thisx->params]); } -} +} \ No newline at end of file