ignore out of bounds entrance overrides in json (#5253)

was causing segfault when using settings from door shuffle on develop
This commit is contained in:
Philip Dubé 2025-05-13 03:33:21 +00:00 committed by GitHub
parent 6a93625f5c
commit f9cde383b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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") {