diff --git a/entrance_rando.py b/entrance_rando.py index 492fff32..578059ae 100644 --- a/entrance_rando.py +++ b/entrance_rando.py @@ -74,13 +74,12 @@ class EntranceLookup: if entrance in self._expands_graph_cache: return self._expands_graph_cache[entrance] - visited = set() + seen = {entrance.connected_region} q: deque[Region] = deque() q.append(entrance.connected_region) while q: region = q.popleft() - visited.add(region) # check if the region itself is progression if region in region.multiworld.indirect_connections: @@ -103,7 +102,8 @@ class EntranceLookup: and exit_ in self._usable_exits): self._expands_graph_cache[entrance] = True return True - elif exit_.connected_region and exit_.connected_region not in visited: + elif exit_.connected_region and exit_.connected_region not in seen: + seen.add(exit_.connected_region) q.append(exit_.connected_region) self._expands_graph_cache[entrance] = False