From e7281c292d3cfad8efe282cca50409c34403a1af Mon Sep 17 00:00:00 2001 From: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:06:17 -0400 Subject: [PATCH] Make your own region cache --- worlds/dark_souls_3/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/worlds/dark_souls_3/__init__.py b/worlds/dark_souls_3/__init__.py index b51668539be2..313d0c8db32a 100644 --- a/worlds/dark_souls_3/__init__.py +++ b/worlds/dark_souls_3/__init__.py @@ -89,6 +89,7 @@ def __init__(self, multiworld: MultiWorld, player: int): self.all_excluded_locations = set() def generate_early(self) -> None: + self.created_regions = set() self.all_excluded_locations.update(self.options.exclude_locations.value) # Inform Universal Tracker where Yhorm is being randomized to. @@ -294,6 +295,7 @@ def create_region(self, region_name, location_table) -> Region: new_region.locations.append(new_location) self.multiworld.regions.append(new_region) + self.created_regions.add(new_region) return new_region def create_items(self) -> None: @@ -1305,7 +1307,7 @@ def _add_location_rule(self, location: Union[str, List[str]], rule: Union[Collec def _add_entrance_rule(self, region: str, rule: Union[CollectionRule, str]) -> None: """Sets a rule for the entrance to the given region.""" assert region in location_tables - if not any(region == reg for reg in self.multiworld.regions.region_cache[self.player]): return + if region not in self.created_regions: return if isinstance(rule, str): if " -> " not in rule: assert item_dictionary[rule].classification == ItemClassification.progression