diff --git a/src/overlays/ovl_i4/fox_sz.c b/src/overlays/ovl_i4/fox_sz.c index 6992e422..75db78ef 100644 --- a/src/overlays/ovl_i4/fox_sz.c +++ b/src/overlays/ovl_i4/fox_sz.c @@ -182,11 +182,18 @@ void SectorZ_Missile_Update(ActorAllRange* this) { } } + s32 bugFixCond; + if (CVarGetInteger("gSzMissileBug", 0) == 1) { + bugFixCond = 0; + } else { + bugFixCond = (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_GFOX_REPAIR); + } + // Level complete trigger check if (((fabsf(this->fwork[MISSILE_TARGET_Z] - this->obj.pos.z) < 2000.0f) && (((gPlayer[0].cam.eye.z < 0.0f) || (D_edisplay_801615D0.y < 0.0f)) || - (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_GFOX_REPAIR))) && - (((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_GFOX_REPAIR)) || + bugFixCond)) && + (((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) || bugFixCond) || (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN))) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_LEVEL_COMPLETE; gPlayer[0].csState = 100; diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp index e7e25a39..ac99a4bc 100644 --- a/src/port/ui/ImguiUI.cpp +++ b/src/port/ui/ImguiUI.cpp @@ -430,6 +430,7 @@ void DrawEnhancementsMenu() { ImGui::EndMenu(); } + if (UIWidgets::BeginMenu("Fixes")) { UIWidgets::CVarCheckbox("Macbeth: Level ending cutscene camera fix", "gMaCameraFix", { .tooltip = "Fixes a camera bug found in the code of the game" @@ -438,6 +439,14 @@ void DrawEnhancementsMenu() { ImGui::EndMenu(); } + if (UIWidgets::BeginMenu("Restoration")) { + UIWidgets::CVarCheckbox("Sector Z: Missile cutscene bug", "gSzMissileBug", { + .tooltip = "Restores the missile cutscene bug present in JP 1.0" + }); + + ImGui::EndMenu(); + } + ImGui::EndMenu(); } }