From f9cde383b7c17faadf875f19e6caf060255bcf3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Tue, 13 May 2025 03:33:21 +0000 Subject: [PATCH] ignore out of bounds entrance overrides in json (#5253) was causing segfault when using settings from door shuffle on develop --- soh/soh/Enhancements/randomizer/entrance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/randomizer/entrance.cpp b/soh/soh/Enhancements/randomizer/entrance.cpp index ac0e4868c..f58dad3bc 100644 --- a/soh/soh/Enhancements/randomizer/entrance.cpp +++ b/soh/soh/Enhancements/randomizer/entrance.cpp @@ -1645,7 +1645,7 @@ void EntranceShuffler::ParseJson(nlohmann::json spoilerFileJson) { try { nlohmann::json entrancesJson = spoilerFileJson["entrances"]; size_t i = 0; - for (auto it = entrancesJson.begin(); it != entrancesJson.end(); ++it, i++) { + for (auto it = entrancesJson.begin(); it != entrancesJson.end() && i < entranceOverrides.size(); ++it, i++) { nlohmann::json entranceJson = *it; for (auto entranceIt = entranceJson.begin(); entranceIt != entranceJson.end(); ++entranceIt) { if (entranceIt.key() == "type") {