diff --git a/soh/soh/Enhancements/randomizer/logic.cpp b/soh/soh/Enhancements/randomizer/logic.cpp index 4a1ede8e7..b2856391f 100644 --- a/soh/soh/Enhancements/randomizer/logic.cpp +++ b/soh/soh/Enhancements/randomizer/logic.cpp @@ -2244,7 +2244,7 @@ const std::vector& GetDungeonSmallKeyDoors(SceneID sceneId) { return dungeonSmallKeyDoors[key]; } -int8_t GetUsedSmallKeyCount(SceneID sceneId) { +int8_t Logic::GetUsedSmallKeyCount(SceneID sceneId) { const auto& smallKeyDoors = GetDungeonSmallKeyDoors(sceneId); // Get the swch value for the scene @@ -2252,7 +2252,7 @@ int8_t GetUsedSmallKeyCount(SceneID sceneId) { if (gPlayState != nullptr && gPlayState->sceneNum == sceneId) { swch = gPlayState->actorCtx.flags.swch; } else { - swch = gSaveContext.sceneFlags[sceneId].swch; + swch = mSaveContext->sceneFlags[sceneId].swch; } // Count the number of small keys doors unlocked diff --git a/soh/soh/Enhancements/randomizer/logic.h b/soh/soh/Enhancements/randomizer/logic.h index 4549c9952..7e0daac90 100644 --- a/soh/soh/Enhancements/randomizer/logic.h +++ b/soh/soh/Enhancements/randomizer/logic.h @@ -267,6 +267,7 @@ class Logic { bool CheckEquipment(uint32_t item); bool CheckQuestItem(uint32_t item); void SetQuestItem(uint32_t item, bool state); + int8_t GetUsedSmallKeyCount(SceneID sceneId); uint8_t GetSmallKeyCount(uint32_t dungeonIndex); void SetSmallKeyCount(uint32_t dungeonIndex, uint8_t count); bool CheckDungeonItem(uint32_t item, uint32_t dungeonIndex);