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).
This commit is contained in:
NewSoupVi 2023-12-07 06:36:46 +01:00 committed by GitHub
parent 87252c14aa
commit 3fa01a41cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -375,7 +375,7 @@ class WitnessPlayerLogic:
if lasers: if lasers:
adjustment_linesets_in_order.append(get_laser_shuffle()) 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() ep_gen = ((ep_hex, ep_obj) for (ep_hex, ep_obj) in self.REFERENCE_LOGIC.ENTITIES_BY_HEX.items()
if ep_obj["entityType"] == "EP") if ep_obj["entityType"] == "EP")
@ -489,7 +489,7 @@ class WitnessPlayerLogic:
self.EVENT_NAMES_BY_HEX[self.VICTORY_LOCATION] = "Victory" self.EVENT_NAMES_BY_HEX[self.VICTORY_LOCATION] = "Victory"
for event_hex, event_name in self.EVENT_NAMES_BY_HEX.items(): 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 continue
self.EVENT_PANELS.add(event_hex) self.EVENT_PANELS.add(event_hex)

View File

@ -71,7 +71,7 @@ class WitnessRegions:
source_region.exits.append(connection) source_region.exits.append(connection)
connection.connect(target_region) connection.connect(target_region)
self.created_entrances[(source, target)].append(connection) self.created_entrances[source, target].append(connection)
# Register any necessary indirect connections # Register any necessary indirect connections
mentioned_regions = { mentioned_regions = {

View File

@ -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: def _can_move_either_direction(state: CollectionState, source: str, target: str, regio: WitnessRegions) -> bool:
entrance_forward = regio.created_entrances[(source, target)] entrance_forward = regio.created_entrances[source, target]
entrance_backward = regio.created_entrances[(source, target)] entrance_backward = regio.created_entrances[target, source]
return ( return (
any(entrance.can_reach(state) for entrance in entrance_forward) any(entrance.can_reach(state) for entrance in entrance_forward)