From 3fa01a41cde73e47512592b4b513514f21b00513 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Thu, 7 Dec 2023 06:36:46 +0100 Subject: [PATCH] The Witness: Fix unreachable locations on certain settings (Keep PP2 EP, Theater Flowers EP) (#2499) Basically, the function for "checking entrances both ways" only checked one way. This resulted in unreachable locations. This affects Expert seeds with (non-remote doors and specific types of EP Shuffle), as well as seeds with non-remote doors + specific types of disabled panels + specific types of EP Shuffle. Also includes two changes that makes spoiler logs nicer (not creating unnecessary events). --- worlds/witness/player_logic.py | 4 ++-- worlds/witness/regions.py | 2 +- worlds/witness/rules.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/worlds/witness/player_logic.py b/worlds/witness/player_logic.py index a4a5b04d..73253efc 100644 --- a/worlds/witness/player_logic.py +++ b/worlds/witness/player_logic.py @@ -375,7 +375,7 @@ class WitnessPlayerLogic: if lasers: adjustment_linesets_in_order.append(get_laser_shuffle()) - if world.options.shuffle_EPs: + if world.options.shuffle_EPs == "obelisk_sides": ep_gen = ((ep_hex, ep_obj) for (ep_hex, ep_obj) in self.REFERENCE_LOGIC.ENTITIES_BY_HEX.items() if ep_obj["entityType"] == "EP") @@ -489,7 +489,7 @@ class WitnessPlayerLogic: self.EVENT_NAMES_BY_HEX[self.VICTORY_LOCATION] = "Victory" for event_hex, event_name in self.EVENT_NAMES_BY_HEX.items(): - if event_hex in self.COMPLETELY_DISABLED_ENTITIES: + if event_hex in self.COMPLETELY_DISABLED_ENTITIES or event_hex in self.IRRELEVANT_BUT_NOT_DISABLED_ENTITIES: continue self.EVENT_PANELS.add(event_hex) diff --git a/worlds/witness/regions.py b/worlds/witness/regions.py index 2187010b..e0970248 100644 --- a/worlds/witness/regions.py +++ b/worlds/witness/regions.py @@ -71,7 +71,7 @@ class WitnessRegions: source_region.exits.append(connection) connection.connect(target_region) - self.created_entrances[(source, target)].append(connection) + self.created_entrances[source, target].append(connection) # Register any necessary indirect connections mentioned_regions = { diff --git a/worlds/witness/rules.py b/worlds/witness/rules.py index 07fea23b..75c662ac 100644 --- a/worlds/witness/rules.py +++ b/worlds/witness/rules.py @@ -66,8 +66,8 @@ def _can_solve_panel(panel: str, world: "WitnessWorld", player: int, player_logi def _can_move_either_direction(state: CollectionState, source: str, target: str, regio: WitnessRegions) -> bool: - entrance_forward = regio.created_entrances[(source, target)] - entrance_backward = regio.created_entrances[(source, target)] + entrance_forward = regio.created_entrances[source, target] + entrance_backward = regio.created_entrances[target, source] return ( any(entrance.can_reach(state) for entrance in entrance_forward)