From 3964051420c8b3562222a3a3f5970ec8cc7a49f8 Mon Sep 17 00:00:00 2001 From: JordanLongstaff Date: Fri, 6 Dec 2024 11:22:28 -0500 Subject: [PATCH] Force setting on in rando --- soh/soh/Enhancements/mods.cpp | 13 ++++--------- soh/soh/SohMenuBar.cpp | 6 +++++- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index f7e05d6bc..0c42ebe1d 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -783,17 +783,12 @@ void RegisterBrokenGiantsKnifeFix() { int32_t bypassEquipmentChecks = 0; - if (CVarGetInteger(CVAR_ENHANCEMENT("FixBrokenGiantsKnife"), 0)) { - // Flag wasn't reset because Kokiri or Master Sword - // was missing, so we need to bypass those checks + if (IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("FixBrokenGiantsKnife"), 0)) { + // Flag wasn't reset because Kokiri or Master Sword was missing, so we need to + // bypass those checks bypassEquipmentChecks |= (1 << EQUIP_INV_SWORD_KOKIRI) | (1 << EQUIP_INV_SWORD_MASTER); - } else if (IS_RANDO) { - // In rando, when buying Giant's Knife, bypass check - // for the Kokiri Sword in case we don't have it - bypassEquipmentChecks |= (1 << EQUIP_INV_SWORD_KOKIRI); } else { - // If neither of the above cases was true, flag should - // be handled exclusively by vanilla behaviour + // If enhancement is off, flag should be handled exclusively by vanilla behaviour return; } diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index 3bec48456..091b01339 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -1525,7 +1525,11 @@ void DrawEnhancementsMenu() { UpdatePatchHand(); } UIWidgets::Tooltip("Fixes Adult Link having a backwards left hand when holding the Megaton Hammer."); - UIWidgets::PaddedEnhancementCheckbox("Fix Broken Giant's Knife bug", CVAR_ENHANCEMENT("FixBrokenGiantsKnife"), true, false); + UIWidgets::PaddedEnhancementCheckbox( + "Fix Broken Giant's Knife bug", CVAR_ENHANCEMENT("FixBrokenGiantsKnife"), true, false, IS_RANDO, + "This setting is forcefully enabled when you are playing a randomizer.", + UIWidgets::CheckboxGraphics::Checkmark + ); UIWidgets::Tooltip("Fixes the Broken Giant's Knife flag not being reset when Medigoron fixes it"); ImGui::EndMenu();