From f87f9889207ed7d2e5834efe8751224c32317249 Mon Sep 17 00:00:00 2001 From: Patrick12115 Date: Tue, 28 Jan 2025 20:38:52 -0500 Subject: [PATCH] Prevent Alt Toggle Crash --- soh/soh/Enhancements/mods.cpp | 4 ++++ soh/soh/OTRGlobals.cpp | 1 + soh/soh/SohMenuBar.cpp | 4 +--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index a7a019737..7762094a4 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -852,6 +852,10 @@ void RegisterPatchCustomEquipmentDlistsHandler() { GameInteractor::Instance->RegisterGameHook([]() { UpdatePatchCustomEquipmentDlists(); }); + + GameInteractor::Instance->RegisterGameHook([]() { + UpdatePatchCustomEquipmentDlists(); + }); } void RegisterResetNaviTimer() { diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 9bc33593d..9ce877a74 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1439,6 +1439,7 @@ extern "C" void Graph_ProcessGfxCommands(Gfx* commands) { bool curAltAssets = CVarGetInteger(CVAR_ENHANCEMENT("AltAssets"), 0); if (prevAltAssets != curAltAssets) { prevAltAssets = curAltAssets; + UpdatePatchCustomEquipmentDlists(); Ship::Context::GetInstance()->GetResourceManager()->SetAltAssetsEnabled(curAltAssets); gfx_texture_cache_clear(); SOH::SkeletonPatcher::UpdateSkeletons(); diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index 5af8e48dd..250106530 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -1319,9 +1319,7 @@ void DrawEnhancementsMenu() { if (ImGui::BeginMenu("Graphics")) { if (ImGui::BeginMenu("Mods")) { - if (UIWidgets::PaddedEnhancementCheckbox("Use Alternate Assets", CVAR_ENHANCEMENT("AltAssets"), false, false)) { - UpdatePatchCustomEquipmentDlists(); - } + UIWidgets::PaddedEnhancementCheckbox("Use Alternate Assets", CVAR_ENHANCEMENT("AltAssets"), false, false); UIWidgets::Tooltip("Toggle between standard assets and alternate assets. Usually mods will indicate if this setting has to be used or not."); UIWidgets::PaddedEnhancementCheckbox("Disable Bomb Billboarding", CVAR_ENHANCEMENT("DisableBombBillboarding"), true, false); UIWidgets::Tooltip("Disables bombs always rotating to face the camera. To be used in conjunction with mods that want to replace bombs with 3D objects.");