[Bugfix] Fixes check tracker crash on max debug file creation (#3309)

* Change initialization of `areasSpoiled` to improve utilization and fix crash during max debug file creation.

* Renamed `RCAreaFromSceneID` to `DungeonRCAreasBySceneID` for clarification.
This commit is contained in:
Malkierian 2023-11-04 14:53:29 -07:00 committed by GitHub
parent 44ee6da0aa
commit e88c8e68b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,7 +96,7 @@ std::map<uint32_t, RandomizerCheck> startingShopItem = { { SCENE_KOKIRI_SHOP, RC
{ SCENE_ZORA_SHOP, RC_ZD_SHOP_ITEM_1 }, { SCENE_ZORA_SHOP, RC_ZD_SHOP_ITEM_1 },
{ SCENE_GORON_SHOP, RC_GC_SHOP_ITEM_1 } }; { SCENE_GORON_SHOP, RC_GC_SHOP_ITEM_1 } };
std::map<SceneID, RandomizerCheckArea> RCAreaFromSceneID = { std::map<SceneID, RandomizerCheckArea> DungeonRCAreasBySceneID = {
{SCENE_DEKU_TREE, RCAREA_DEKU_TREE}, {SCENE_DEKU_TREE, RCAREA_DEKU_TREE},
{SCENE_DODONGOS_CAVERN, RCAREA_DODONGOS_CAVERN}, {SCENE_DODONGOS_CAVERN, RCAREA_DODONGOS_CAVERN},
{SCENE_JABU_JABU, RCAREA_JABU_JABUS_BELLY}, {SCENE_JABU_JABU, RCAREA_JABU_JABUS_BELLY},
@ -1157,9 +1157,11 @@ bool IsVisibleInCheckTracker(RandomizerCheckObject rcObj) {
void UpdateInventoryChecks() { void UpdateInventoryChecks() {
//For all the areas with compasses, if you have one, spoil the area //For all the areas with compasses, if you have one, spoil the area
for (u8 i = SCENE_DEKU_TREE; i <= SCENE_GERUDO_TRAINING_GROUND; i++) for (auto [scene, area] : DungeonRCAreasBySceneID) {
if (CHECK_DUNGEON_ITEM(DUNGEON_MAP, i)) if (CHECK_DUNGEON_ITEM(DUNGEON_MAP, scene)) {
areasSpoiled |= (1 << RCAreaFromSceneID.at((SceneID)i)); areasSpoiled |= (1 << area);
}
}
} }
void UpdateAreaFullyChecked(RandomizerCheckArea area) { void UpdateAreaFullyChecked(RandomizerCheckArea area) {