Fix entrance optimization (#5520)

I'm an idiot
This commit is contained in:
Philip Dubé 2025-05-20 05:47:04 +00:00 committed by GitHub
parent e1f6297807
commit 4216776cd6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -535,17 +535,17 @@ std::string CleanCheckConditionString(std::string condition) {
}
namespace Regions {
const auto GetAllRegions() {
auto GetAllRegions() {
static const size_t regionCount = RR_MAX - (RR_NONE + 1);
static std::array<RandomizerRegion, regionCount> allRegions = {};
static bool intialized = false;
if (!intialized) {
static bool initialized = false;
if (!initialized) {
for (size_t i = 0; i < regionCount; i++) {
allRegions[i] = (RandomizerRegion)((RR_NONE + 1) + i);
}
intialized = true;
initialized = true;
}
return allRegions;
@ -684,7 +684,7 @@ std::vector<Rando::Entrance*> GetShuffleableEntrances(Rando::EntranceType type,
Rando::Entrance* GetEntrance(RandomizerRegion source, RandomizerRegion destination) {
for (auto& exit : RegionTable(source)->exits) {
if (exit.GetConnectedRegionKey() == destination) {
if (exit.GetOriginalConnectedRegionKey() == destination) {
return &exit;
}
}