diff --git a/soh/soh/Enhancements/randomizer/entrance.cpp b/soh/soh/Enhancements/randomizer/entrance.cpp index 676985623..1daed0a25 100644 --- a/soh/soh/Enhancements/randomizer/entrance.cpp +++ b/soh/soh/Enhancements/randomizer/entrance.cpp @@ -1694,41 +1694,4 @@ extern "C" { EntranceOverride* Randomizer_GetEntranceOverrides() { return Rando::Context::GetInstance()->GetEntranceShuffler()->entranceOverrides.data(); } - -void Randomizer_DiscoverRegion(Region* region, std::unordered_set& visitedRegions) { - region->IsDiscovered = true; - - for (const auto& exit : region->exits) { - if (!exit.IsShuffled()) { - RandomizerRegion connectedRegionKey = exit.GetConnectedRegionKey(); - if (visitedRegions.contains(connectedRegionKey)) { - continue; - } - visitedRegions.insert(connectedRegionKey); - - Randomizer_DiscoverRegion(exit.GetConnectedRegion(), visitedRegions); - } - } -} - -void Randomizer_RegionDiscovered(RandomizerRegion region) { - std::unordered_set visitedRegions; - Randomizer_DiscoverRegion(&areaTable[region], visitedRegions); -} - -void Randomizer_EntranceDiscovered(s16 index, bool recalculateAvailableChecks) { - auto entranceEntry = Rando::entranceMap.find(index); - if (entranceEntry == Rando::entranceMap.end()) { - return; - } - - Rando::Entrance* entrance = entranceEntry->second; - RandomizerRegion connectedRegionKey = entrance->GetConnectedRegionKey(); - - Randomizer_RegionDiscovered(connectedRegionKey); - - if (recalculateAvailableChecks) { - CheckTracker::RecalculateAvailableChecks(); - } -} } \ No newline at end of file diff --git a/soh/soh/Enhancements/randomizer/entrance.h b/soh/soh/Enhancements/randomizer/entrance.h index 0b2e5eb9d..6cb631db3 100644 --- a/soh/soh/Enhancements/randomizer/entrance.h +++ b/soh/soh/Enhancements/randomizer/entrance.h @@ -153,8 +153,6 @@ class EntranceShuffler { extern "C" { #endif EntranceOverride* Randomizer_GetEntranceOverrides(); -void Randomizer_RegionDiscovered(RandomizerRegion region); -void Randomizer_EntranceDiscovered(s16 index, bool recalculateAvailableChecks); #ifdef __cplusplus } #endif diff --git a/soh/soh/Enhancements/randomizer/location_access.h b/soh/soh/Enhancements/randomizer/location_access.h index a8ab192f9..5aed64070 100644 --- a/soh/soh/Enhancements/randomizer/location_access.h +++ b/soh/soh/Enhancements/randomizer/location_access.h @@ -137,8 +137,6 @@ class Region { bool adultNight = false; bool addedToPool = false; - bool IsDiscovered = false; - void ApplyTimePass(); bool UpdateEvents(); diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp index 066dc4952..85dcf53b5 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp @@ -585,12 +585,6 @@ void CheckTrackerLoadGame(int32_t fileNum) { if (Rando::Context::GetInstance()->GetOption(RSK_SHUFFLE_ENTRANCES).Get()) { Rando::Context::GetInstance()->GetEntranceShuffler()->ApplyEntranceOverrides(); - - for (s16 entranceIndex = 0; entranceIndex < MAX_ENTRANCE_RANDO_USED_INDEX; entranceIndex++) { - if (IsEntranceDiscovered(entranceIndex)) { - Randomizer_EntranceDiscovered(entranceIndex, false); - } - } } RecalculateAvailableChecks(); @@ -2150,13 +2144,6 @@ void CheckTrackerSettingsWindow::DrawElement() { "with your current progress.") .Color(THEME_COLOR))) { enableAvailableChecks = CVarGetInteger(CVAR_TRACKER_CHECK("EnableAvailableChecks"), 0); - - for (s16 entranceIndex = 0; entranceIndex < ENTR_MAX; entranceIndex++) { - if (IsEntranceDiscovered(entranceIndex)) { - Randomizer_EntranceDiscovered(entranceIndex, false); - } - } - RecalculateAvailableChecks(); } ImGui::EndDisabled(); diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance.c b/soh/soh/Enhancements/randomizer/randomizer_entrance.c index 5d50ca142..faec117eb 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance.c +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance.c @@ -809,7 +809,7 @@ void Entrance_SetEntranceDiscovered(u16 entranceIndex, u8 isReversedEntrance) { if (idx < SAVEFILE_ENTRANCES_DISCOVERED_IDX_COUNT) { u32 entranceBit = 1 << (entranceIndex - (idx * bitsPerIndex)); gSaveContext.ship.stats.entrancesDiscovered[idx] |= entranceBit; - Randomizer_EntranceDiscovered(entranceIndex, true); + CheckTracker_RecalculateAvailableChecks(); // Set reverse entrance when not decoupled if (!Randomizer_GetSettingValue(RSK_DECOUPLED_ENTRANCES) && !isReversedEntrance) { diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 72030657e..c0a897290 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -2608,4 +2608,7 @@ void SoH_ProcessDroppedFiles(std::string filePath) { return; } } -// #endregion + +extern "C" void CheckTracker_RecalculateAvailableChecks() { + CheckTracker::RecalculateAvailableChecks(); +} diff --git a/soh/soh/OTRGlobals.h b/soh/soh/OTRGlobals.h index b14d322d2..bcc5c8657 100644 --- a/soh/soh/OTRGlobals.h +++ b/soh/soh/OTRGlobals.h @@ -163,6 +163,7 @@ void Gfx_UnregisterBlendedTexture(const char* name); void Gfx_TextureCacheDelete(const uint8_t* addr); void SaveManager_ThreadPoolWait(); void CheckTracker_OnMessageClose(); +void CheckTracker_RecalculateAvailableChecks(); GetItemID RetrieveGetItemIDFromItemID(ItemID itemID); RandomizerGet RetrieveRandomizerGetFromItemID(ItemID itemID);