From 93659b5ded231f58253aef43717561086fba8f03 Mon Sep 17 00:00:00 2001 From: Anthony Stewart Date: Wed, 16 Apr 2025 21:50:20 -0500 Subject: [PATCH] Move entrance discovered into ProcessExits. --- soh/soh/Enhancements/randomizer/3drando/fill.cpp | 6 ++++++ .../Enhancements/randomizer/randomizer_check_tracker.cpp | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/3drando/fill.cpp b/soh/soh/Enhancements/randomizer/3drando/fill.cpp index dcae4842c..2ff58af76 100644 --- a/soh/soh/Enhancements/randomizer/3drando/fill.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/fill.cpp @@ -209,6 +209,12 @@ void ProcessExits(Region* region, GetAccessibleLocationsStruct& gals, Randomizer bool stopOnBeatable = false, bool addToPlaythrough = false) { auto ctx = Rando::Context::GetInstance(); for (auto& exit : region->exits) { + int16_t entranceIndex = exit.GetIndex(); + if (gals.calculatingAvailableChecks && ctx->GetOption(RSK_SHUFFLE_ENTRANCES).Get() && exit.IsShuffled() && + entranceIndex != -1 && !Entrance_GetIsEntranceDiscovered(entranceIndex)) { + continue; + } + Region* exitRegion = exit.GetConnectedRegion(); // Update Time of Day Access for the exit if (UpdateToDAccess(&exit, exitRegion)) { diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp index d53ca9da7..9c3d2cc8a 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp @@ -591,6 +591,10 @@ void CheckTrackerLoadGame(int32_t fileNum) { Randomizer_EntranceDiscovered(entranceIndex, false); } } + + // RANDOTODO: This is needed because using the master sword does not discover the spawn entrance. + Entrance_SetEntranceDiscovered(ENTR_LINKS_HOUSE_CHILD_SPAWN, false); + Entrance_SetEntranceDiscovered(ENTR_HYRULE_FIELD_10, false); } RecalculateAvailableChecks(); @@ -2018,10 +2022,6 @@ void RecalculateAvailableChecks() { const auto& itemLocation = ctx->GetItemLocation(rc); const auto& region = areaTable[itemLocation->GetParentRegionKey()]; - if (ctx->GetOption(RSK_SHUFFLE_ENTRANCES).Get() && !region.IsDiscovered) { - continue; - } - if (location->GetRCType() == RCTYPE_SHOP && itemLocation->GetCheckStatus() == RCSHOW_IDENTIFIED) { if (CanBuyAnother(rc)) { itemLocation->SetAvailable(true);