OOT: Fix incorrect region accessibility after update_reachable_regions() (#3712)

`CollectionState.update_reachable_regions()` un-stales the state for all
players, but when checking `OOTRegion.can_reach()`, it would only update
OOT's age region accessibility when the state was stale, so if the state
was always un-staled by `update_reachable_regions()` immediately before
`OOTRegion.can_reach()`, OOT's age region accessibility would never
update.

This patch fixes the issue by replacing use of CollectionState.stale
with a separate stale state dictionary specific to OOT that is only
un-staled by `_oot_update_age_reachable_regions()`.

OOT's collect() and remove() implementations have been updated to stale
the new OOT-specific state.
This commit is contained in:
Mysteryem
2024-09-17 14:11:35 +01:00
committed by GitHub
parent 96542fb2d8
commit dae3fe188d
3 changed files with 17 additions and 7 deletions

View File

@@ -64,7 +64,7 @@ class OOTRegion(Region):
return None
def can_reach(self, state):
if state.stale[self.player]:
if state._oot_stale[self.player]:
stored_age = state.age[self.player]
state._oot_update_age_reachable_regions(self.player)
state.age[self.player] = stored_age