Fixes some "seed bleed" instances (#3766)

* Should fix seed bleed between multiple saves and loaded spoilers by resetting the Rando::Context before loading a save.

* Only reset for rando saves.
This commit is contained in:
Christopher Leggett 2023-12-30 12:09:46 -05:00 committed by GitHub
parent 75f9775ad8
commit 8cb06d2d5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2721,6 +2721,11 @@ extern "C" void Save_SaveGlobal(void) {
}
extern "C" void Save_LoadFile(void) {
if (gSaveContext.questId == QUEST_RANDOMIZER) {
// Reset rando context for rando saves.
OTRGlobals::Instance->gRandoContext.reset();
OTRGlobals::Instance->gRandoContext = Rando::Context::CreateInstance();
}
SaveManager::Instance->LoadFile(gSaveContext.fileNum);
}