From 352a4e92604744c72143d747bb84171f547131f5 Mon Sep 17 00:00:00 2001 From: xxAtrain223 Date: Mon, 15 Dec 2025 13:49:11 -0600 Subject: [PATCH] Added small key doors special case for Thieves Hideout. (#6023) --- soh/soh/Enhancements/randomizer/logic.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/randomizer/logic.cpp b/soh/soh/Enhancements/randomizer/logic.cpp index fd578d7de..382be7bdf 100644 --- a/soh/soh/Enhancements/randomizer/logic.cpp +++ b/soh/soh/Enhancements/randomizer/logic.cpp @@ -2118,6 +2118,21 @@ void Logic::SetQuestItem(uint32_t item, bool state) { } } +const std::vector& GetThievesHideoutSmallKeyDoors() { + // Retrieved from scenes/shared/gerudoway_scene/gerudoway_room_%d + // SOH::SceneCommandID::SetActorList, actor.id == ACTOR_DOOR_GERUDO, actor.params & 0x3F + static const std::vector normalSmallKeyDoors{ 1, 2, 3, 4 }; + static const std::vector fastSmallKeyDoors{ 1 }; + static const std::vector freeSmallKeyDoors{}; + + if (RAND_GET_OPTION(RSK_GERUDO_FORTRESS) == RO_GF_CARPENTERS_NORMAL) { + return normalSmallKeyDoors; + } else if (RAND_GET_OPTION(RSK_GERUDO_FORTRESS) == RO_GF_CARPENTERS_FAST) { + return fastSmallKeyDoors; + } + return freeSmallKeyDoors; +} + // Get the swch bit positions for the dungeon const std::vector& GetDungeonSmallKeyDoors(SceneID sceneId) { static const std::vector emptyVector; @@ -2183,7 +2198,8 @@ const std::vector& GetDungeonSmallKeyDoors(SceneID sceneId) { } int8_t Logic::GetUsedSmallKeyCount(SceneID sceneId) { - const auto& smallKeyDoors = GetDungeonSmallKeyDoors(sceneId); + const auto& smallKeyDoors = + (sceneId == SCENE_THIEVES_HIDEOUT) ? GetThievesHideoutSmallKeyDoors() : GetDungeonSmallKeyDoors(sceneId); // Get the swch value for the scene uint32_t swch;