From cc3d5e60a1d94c363c8aac73e03780d3f1a7b97b Mon Sep 17 00:00:00 2001 From: espeon65536 Date: Tue, 16 Nov 2021 08:24:30 -0600 Subject: [PATCH] OoT: ensure that the last entrance placed in a one-way pool doesn't assume the other targets are reachable --- worlds/oot/EntranceShuffle.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/worlds/oot/EntranceShuffle.py b/worlds/oot/EntranceShuffle.py index 31ee8669..e66193bf 100644 --- a/worlds/oot/EntranceShuffle.py +++ b/worlds/oot/EntranceShuffle.py @@ -1,7 +1,7 @@ from itertools import chain import logging -from worlds.generic.Rules import set_rule +from worlds.generic.Rules import set_rule, add_rule from .Hints import get_hint_area, HintAreaNotFound from .Regions import TimeOfDay @@ -425,7 +425,9 @@ def shuffle_random_entrances(ootworld): elif pool_type in {'Spawn', 'WarpSong'}: valid_target_types = ('Spawn', 'WarpSong', 'OwlDrop', 'Overworld', 'Interior', 'SpecialInterior', 'Extra') one_way_target_entrance_pools[pool_type] = build_one_way_targets(ootworld, valid_target_types) - # Ensure that the last entrance doesn't assume the rest of the targets are reachable? + # Ensure that the last entrance doesn't assume the rest of the targets are reachable + for target in one_way_target_entrance_pools[pool_type]: + add_rule(target, (lambda entrances=entrance_pool: (lambda state: any(entrance.connected_region == None for entrance in entrances)))()) # Disconnect one-way entrances for priority placement for entrance in chain.from_iterable(one_way_entrance_pools.values()): entrance.disconnect()