From 53c806b4ddc5b0ddf98c1c7b89d76096d88b1730 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sat, 30 Sep 2023 07:51:43 +0200 Subject: [PATCH] Fill: remove sweep_for_events(key_only=True) --- BaseClasses.py | 7 ++----- Fill.py | 1 - worlds/alttp/SubClasses.py | 4 ---- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index 535338b4ec75..df6a04a61135 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -712,13 +712,12 @@ def can_reach(self, spot = self.multiworld.get_region(spot, player) return spot.can_reach(self) - def sweep_for_events(self, key_only: bool = False, locations: Optional[Iterable[Location]] = None) -> None: + def sweep_for_events(self, locations: Optional[Iterable[Location]] = None) -> None: if locations is None: locations = self.multiworld.get_filled_locations() reachable_events = True # since the loop has a good chance to run more than once, only filter the events once - locations = {location for location in locations if location.event and location not in self.events and - not key_only or getattr(location.item, "locked_dungeon_item", False)} + locations = {location for location in locations if location.event and location not in self.events} while reachable_events: reachable_events = {location for location in locations if location.can_reach(self)} locations -= reachable_events @@ -1184,8 +1183,6 @@ def create_playthrough(self, create_paths: bool = True) -> None: state = CollectionState(multiworld) collection_spheres = [] while required_locations: - state.sweep_for_events(key_only=True) - sphere = set(filter(state.can_reach, required_locations)) for location in sphere: diff --git a/Fill.py b/Fill.py index 7c81aed7ba93..5db5aa4fb0a6 100644 --- a/Fill.py +++ b/Fill.py @@ -564,7 +564,6 @@ def balance_multiworld_progression(world: MultiWorld) -> None: def get_sphere_locations(sphere_state: CollectionState, locations: typing.Set[Location]) -> typing.Set[Location]: - sphere_state.sweep_for_events(key_only=True, locations=locations) return {loc for loc in locations if sphere_state.can_reach(loc)} def item_percentage(player: int, num: int) -> float: diff --git a/worlds/alttp/SubClasses.py b/worlds/alttp/SubClasses.py index 64e4adaec9a2..efa381fc0a86 100644 --- a/worlds/alttp/SubClasses.py +++ b/worlds/alttp/SubClasses.py @@ -66,10 +66,6 @@ def dungeon_item(self) -> Optional[str]: if self.type in {"SmallKey", "BigKey", "Map", "Compass"}: return self.type - @property - def locked_dungeon_item(self): - return self.location.locked and self.dungeon_item - class LTTPRegionType(IntEnum): LightWorld = 1