Move entrance discovered into ProcessExits.

This commit is contained in:
Anthony Stewart 2025-04-16 21:50:20 -05:00
commit 93659b5ded
2 changed files with 10 additions and 4 deletions

View file

@ -209,6 +209,12 @@ void ProcessExits(Region* region, GetAccessibleLocationsStruct& gals, Randomizer
bool stopOnBeatable = false, bool addToPlaythrough = false) { bool stopOnBeatable = false, bool addToPlaythrough = false) {
auto ctx = Rando::Context::GetInstance(); auto ctx = Rando::Context::GetInstance();
for (auto& exit : region->exits) { 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(); Region* exitRegion = exit.GetConnectedRegion();
// Update Time of Day Access for the exit // Update Time of Day Access for the exit
if (UpdateToDAccess(&exit, exitRegion)) { if (UpdateToDAccess(&exit, exitRegion)) {

View file

@ -591,6 +591,10 @@ void CheckTrackerLoadGame(int32_t fileNum) {
Randomizer_EntranceDiscovered(entranceIndex, false); 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(); RecalculateAvailableChecks();
@ -2018,10 +2022,6 @@ void RecalculateAvailableChecks() {
const auto& itemLocation = ctx->GetItemLocation(rc); const auto& itemLocation = ctx->GetItemLocation(rc);
const auto& region = areaTable[itemLocation->GetParentRegionKey()]; 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 (location->GetRCType() == RCTYPE_SHOP && itemLocation->GetCheckStatus() == RCSHOW_IDENTIFIED) {
if (CanBuyAnother(rc)) { if (CanBuyAnother(rc)) {
itemLocation->SetAvailable(true); itemLocation->SetAvailable(true);