fix(generation): reduce memory usage for bunny walk calculations
fix(key logic): make partial the default
This commit is contained in:
7
Rules.py
7
Rules.py
@@ -1891,14 +1891,16 @@ def set_bunny_rules(world, player, inverted):
|
||||
# a) being able to reach it, and
|
||||
# b) being able to access all entrances from there to `region`
|
||||
queue = deque([(region, [], {region})])
|
||||
seen_sets = set([frozenset({region})])
|
||||
while queue:
|
||||
(current, path, seen) = queue.popleft()
|
||||
for entrance in current.entrances:
|
||||
new_region = entrance.parent_region
|
||||
if new_region.type in (RegionType.Cave, RegionType.Dungeon) and new_region in seen:
|
||||
new_seen = seen.union({new_region})
|
||||
if new_region.type in (RegionType.Cave, RegionType.Dungeon) and new_seen in seen_sets:
|
||||
continue
|
||||
new_path = path + [entrance.access_rule]
|
||||
new_seen = seen.union({new_region})
|
||||
seen_sets.add(frozenset(new_seen))
|
||||
if not is_link(new_region):
|
||||
if world.logic[player] == 'owglitches':
|
||||
if region.type == RegionType.Dungeon and new_region.type != RegionType.Dungeon:
|
||||
@@ -1935,6 +1937,7 @@ def set_bunny_rules(world, player, inverted):
|
||||
else:
|
||||
continue
|
||||
if is_bunny(new_region):
|
||||
# todo: if not owg or hmg and entrance is in bunny_impassible_doors, then skip this nonsense?
|
||||
queue.append((new_region, new_path, new_seen))
|
||||
else:
|
||||
# we have reached pure light world, so we have a new possible option
|
||||
|
||||
Reference in New Issue
Block a user