diff --git a/soh/soh/Enhancements/randomizer/3drando/location_access.cpp b/soh/soh/Enhancements/randomizer/3drando/location_access.cpp index b181a3cdb..a64ef5f55 100644 --- a/soh/soh/Enhancements/randomizer/3drando/location_access.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/location_access.cpp @@ -240,12 +240,12 @@ bool HasAccessTo(const RandomizerRegion area) { return areaTable[area].HasAccess(); } -std::shared_ptr randoCtx; +Rando::Context* randoCtx; std::shared_ptr logic; void AreaTable_Init() { using namespace Rando; - randoCtx = Context::GetInstance(); + randoCtx = Context::GetInstance().get(); logic = randoCtx->GetLogic(); grottoEvents = { EventAccess(&logic->GossipStoneFairy, { [] { return logic->GossipStoneFairy || logic->CanSummonGossipFairy; } }), diff --git a/soh/soh/Enhancements/randomizer/3drando/location_access.hpp b/soh/soh/Enhancements/randomizer/3drando/location_access.hpp index 1492e82ec..286551cab 100644 --- a/soh/soh/Enhancements/randomizer/3drando/location_access.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/location_access.hpp @@ -12,7 +12,7 @@ typedef bool (*ConditionFn)(); // I hate this but every alternative I can think of right now is worse -extern std::shared_ptr randoCtx; +extern Rando::Context* randoCtx; extern std::shared_ptr logic; class EventAccess { diff --git a/soh/soh/Enhancements/randomizer/entrance.cpp b/soh/soh/Enhancements/randomizer/entrance.cpp index 16fbdfd3b..39eab1398 100644 --- a/soh/soh/Enhancements/randomizer/entrance.cpp +++ b/soh/soh/Enhancements/randomizer/entrance.cpp @@ -235,6 +235,11 @@ Entrance* Entrance::AssumeReachable() { return assumed; } +EntranceShuffler::EntranceShuffler() { + playthroughEntrances = {}; + entranceOverrides = {}; +} + bool EntranceShuffler::HasNoRandomEntrances() { return mNoRandomEntrances; } diff --git a/soh/soh/Enhancements/randomizer/entrance.h b/soh/soh/Enhancements/randomizer/entrance.h index e17687842..08861ff0d 100644 --- a/soh/soh/Enhancements/randomizer/entrance.h +++ b/soh/soh/Enhancements/randomizer/entrance.h @@ -115,6 +115,7 @@ using EntrancePools = std::map>; class EntranceShuffler { public: + EntranceShuffler(); std::array entranceOverrides; std::vector> playthroughEntrances; bool HasNoRandomEntrances(); diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index 00cd3115e..448a8d2e0 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -2841,7 +2841,7 @@ extern "C" void Save_SaveGlobal(void) { } extern "C" void Save_LoadFile(void) { - if (gSaveContext.questId == QUEST_RANDOMIZER) { + if (SaveManager::Instance->fileMetaInfo[gSaveContext.fileNum].randoSave) { // Reset rando context for rando saves. OTRGlobals::Instance->gRandoContext.reset(); OTRGlobals::Instance->gRandoContext = Rando::Context::CreateInstance();