From 04ed1825f0c520c6274adbdbccf6b84d00b63059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Thu, 19 Mar 2026 15:50:52 +0000 Subject: [PATCH] Fix excluded locations regressions causing crash (#6375) --- soh/soh/SohGui/SohMenuRandomizer.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/soh/soh/SohGui/SohMenuRandomizer.cpp b/soh/soh/SohGui/SohMenuRandomizer.cpp index 710f52207..b5b9ece98 100644 --- a/soh/soh/SohGui/SohMenuRandomizer.cpp +++ b/soh/soh/SohGui/SohMenuRandomizer.cpp @@ -105,7 +105,7 @@ void DrawLocationsMenu(WidgetInfo& info) { if (!excludedLocationString.empty()) { excludedLocationString += ","; } - excludedLocationString += excludedLocationIt; + excludedLocationString += std::to_string(excludedLocationIt); } CVarSetString(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), excludedLocationString.c_str()); @@ -152,7 +152,7 @@ void DrawLocationsMenu(WidgetInfo& info) { if (!excludedLocationString.empty()) { excludedLocationString += ","; } - excludedLocationString += excludedLocationIt; + excludedLocationString += std::to_string(excludedLocationIt); } if (excludedLocationString == "") { CVarClear(CVAR_RANDOMIZER_SETTING("ExcludedLocations")); @@ -188,7 +188,9 @@ void UpdateMenuLocations() { std::string excludedLocationString; excludedLocations.clear(); while (getline(excludedLocationStringStream, excludedLocationString, ',')) { - excludedLocations.insert((RandomizerCheck)std::stoi(excludedLocationString)); + if (!excludedLocationString.empty()) { + excludedLocations.insert((RandomizerCheck)std::stoi(excludedLocationString)); + } } } @@ -207,7 +209,9 @@ void UpdateMenuTricks() { std::string enabledGlitchString; enabledGlitches.clear(); while (getline(enabledGlitchStringStream, enabledGlitchString, ',')) { - enabledGlitches.insert((RandomizerTrick)std::stoi(enabledGlitchString)); + if (!enabledGlitchString.empty()) { + enabledGlitches.insert((RandomizerTrick)std::stoi(enabledGlitchString)); + } } }