Fix: Rando settings not being initialized in time (#2461)

* fix entrance init and entrance tracker not working properly when no spoiler log is loaded

* fix rando adult trade spoilable items reverting when no spoiler log loaded
This commit is contained in:
Adam Bird 2023-02-13 02:00:59 -05:00 committed by GitHub
parent 1e9f8df33b
commit 67421179e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 13 deletions

View File

@ -204,6 +204,8 @@ void SaveManager::LoadRandomizerVersion2() {
std::shared_ptr<Randomizer> randomizer = OTRGlobals::Instance->gRandomizer;
randomizer->LoadRandomizerSettings("");
size_t merchantPricesSize = 0;
SaveManager::Instance->LoadData("merchantPricesSize", merchantPricesSize);

View File

@ -197,12 +197,6 @@ void Sram_OpenSave() {
}
}
// Setup the modified entrance table and entrance shuffle table for rando
if (gSaveContext.n64ddFlag) {
Entrance_Init();
Entrance_InitEntranceTrackingData();
}
osSyncPrintf("scene_no = %d\n", gSaveContext.entranceIndex);
osSyncPrintf(VT_RST);

View File

@ -2143,13 +2143,19 @@ void FileChoose_LoadGame(GameState* thisx) {
}
}
// Handle randomized spawn positions after the save context has been setup from load
// When remeber save location is on, set save warp if the save was in an a grotto, or
// the entrance index is -1 from shuffle overwarld spawn
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES) && ((!CVarGetInteger("gRememberSaveLocation", 0) ||
gSaveContext.savedSceneNum == SCENE_YOUSEI_IZUMI_TATE || gSaveContext.savedSceneNum == SCENE_KAKUSIANA) ||
(CVarGetInteger("gRememberSaveLocation", 0) && Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_SPAWNS) && gSaveContext.entranceIndex == -1))) {
Entrance_SetSavewarpEntrance();
if (gSaveContext.n64ddFlag) {
// Setup the modified entrance table and entrance shuffle table for rando
Entrance_Init();
Entrance_InitEntranceTrackingData();
// Handle randomized spawn positions after the save context has been setup from load
// When remeber save location is on, set save warp if the save was in an a grotto, or
// the entrance index is -1 from shuffle overwarld spawn
if (Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES) && ((!CVarGetInteger("gRememberSaveLocation", 0) ||
gSaveContext.savedSceneNum == SCENE_YOUSEI_IZUMI_TATE || gSaveContext.savedSceneNum == SCENE_KAKUSIANA) ||
(CVarGetInteger("gRememberSaveLocation", 0) && Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_SPAWNS) && gSaveContext.entranceIndex == -1))) {
Entrance_SetSavewarpEntrance();
}
}
}