Fix failure to assign areas to regions on initial spoiler load (#5540)

This commit is contained in:
Pepper0ni 2025-05-27 21:19:30 +01:00 committed by GitHub
parent de96f3cd0a
commit f0e36c2694
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 1 deletions

View file

@ -56,6 +56,7 @@ struct GetAccessibleLocationsStruct {
void ClearProgress(); void ClearProgress();
void VanillaFill(); void VanillaFill();
int Fill(); int Fill();
void SetAreas();
std::vector<RandomizerCheck> GetEmptyLocations(std::vector<RandomizerCheck> allowedLocations); std::vector<RandomizerCheck> GetEmptyLocations(std::vector<RandomizerCheck> allowedLocations);

View file

@ -400,9 +400,9 @@ void Context::ParseSpoiler(const char* spoilerFileName) {
ParseHashIconIndexesJson(spoilerFileJson); ParseHashIconIndexesJson(spoilerFileJson);
Rando::Settings::GetInstance()->ParseJson(spoilerFileJson); Rando::Settings::GetInstance()->ParseJson(spoilerFileJson);
ParseItemLocationsJson(spoilerFileJson); ParseItemLocationsJson(spoilerFileJson);
ParseHintJson(spoilerFileJson);
ParseTricksJson(spoilerFileJson); ParseTricksJson(spoilerFileJson);
mEntranceShuffler->ParseJson(spoilerFileJson); mEntranceShuffler->ParseJson(spoilerFileJson);
ParseHintJson(spoilerFileJson);
mDungeons->ParseJson(spoilerFileJson); mDungeons->ParseJson(spoilerFileJson);
mTrials->ParseJson(spoilerFileJson); mTrials->ParseJson(spoilerFileJson);
mSpoilerLoaded = true; mSpoilerLoaded = true;

View file

@ -1666,6 +1666,10 @@ void EntranceShuffler::ParseJson(nlohmann::json spoilerFileJson) {
} }
} }
} catch (const std::exception& e) { throw e; } } catch (const std::exception& e) { throw e; }
// We may need to reset more things here or elsewhere in spoiler loading
RegionTable_Init();
ApplyEntranceOverrides();
SetAreas();
} }
void EntranceShuffler::ApplyEntranceOverrides() { void EntranceShuffler::ApplyEntranceOverrides() {