Skip to content

Commit cbb31f4

Browse files
requested adjustments
1 parent 11e4d83 commit cbb31f4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

EntranceRando.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,9 @@ def find_pairing(dead_end: bool, require_new_regions: bool) -> bool:
308308
for target_entrance in entrance_lookup.get_targets(target_groups, dead_end, preserve_group_order):
309309
# TODO - requiring new regions is a proxy for requiring new entrances to be unlocked, which is
310310
# not quite full fidelity so we may need to revisit this in the future
311-
if ((not require_new_regions or target_entrance.connected_region not in er_state.placed_regions)
312-
and source_exit.can_connect_to(target_entrance, er_state)):
311+
region_requirement_satisfied = (not require_new_regions
312+
or target_entrance.connected_region not in er_state.placed_regions)
313+
if region_requirement_satisfied and source_exit.can_connect_to(target_entrance, er_state):
313314
do_placement(source_exit, target_entrance)
314315
return True
315316
else:
@@ -324,7 +325,7 @@ def find_pairing(dead_end: bool, require_new_regions: bool) -> bool:
324325
if all(e.connected_region in er_state.placed_regions for e in lookup):
325326
return False
326327

327-
raise RuntimeError(f"None of the available exits are valid targets for the available entrances.\n"
328+
raise RuntimeError(f"None of the available entrances are valid targets for the available exits.\n"
328329
f"Available entrances: {lookup}\n"
329330
f"Available exits: {er_state.placeable_exits}")
330331

0 commit comments

Comments
 (0)