From f68a4e930df6432f21b1c9f7d2c7e5649eae6e39 Mon Sep 17 00:00:00 2001 From: Malkierian Date: Sun, 6 Aug 2023 09:01:19 -0700 Subject: [PATCH] [Bugfix] Add check for animation count to prevent continuing final saw textbox while putaway is happening (#3103) * Add check for animation count to prevent continuing final saw textbox while putaway is happening. * Added Fix toggle for it. Enabling Skip Text forces the behavior, regardless of previous selection for the Fix toggle itself (so it works if you have the Fix toggle enabled, or if you have Skip Text enabled). * Clarified the comment in `z_en_toryo`. --- soh/soh/SohMenuBar.cpp | 3 +++ soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index 64e6a0c4a..76fef97ed 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -1007,6 +1007,9 @@ void DrawEnhancementsMenu() { ApplyAuthenticGfxPatches(); } UIWidgets::Tooltip("Fixes authentic out of bounds texture reads, instead loading textures with the correct size"); + UIWidgets::PaddedEnhancementCheckbox("Fix Poacher's Saw Softlock", "gFixSawSoftlock", true, false, CVarGetInteger("gSkipText", 0), + "This is disabled because it is forced on when Skip Text is enabled.", UIWidgets::CheckboxGraphics::Checkmark); + UIWidgets::Tooltip("Prevents the Poacher's Saw softlock from mashing through the text, or with Skip Text enabled."); ImGui::EndMenu(); } diff --git a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index 289a4394a..b7f30f1a6 100644 --- a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -291,7 +291,10 @@ void func_80B20768(EnToryo* this, PlayState* play) { s16 sp32; s16 sp30; - if (this->unk_1E4 == 3) { + // Animation Count should be no more than 1 to guarantee putaway is complete after giving the saw + // As this is vanilla behavior, it only applies with the Fix toggle or Skip Text enabled. + bool checkAnim = (CVarGetInteger("gFixSawSoftlock", 0) != 0 || CVarGetInteger("gSkipText", 0) != 0) ? play->animationCtx.animationCount <= 1 : true; + if (this->unk_1E4 == 3 && checkAnim) { Actor_ProcessTalkRequest(&this->actor, play); Message_ContinueTextbox(play, this->actor.textId); this->unk_1E4 = 1;