From 5e2a5f2e8eeddcc8549261a3bb03b577e3194d04 Mon Sep 17 00:00:00 2001 From: aerinon Date: Tue, 3 Mar 2020 12:39:52 -0700 Subject: [PATCH] Bugfix for a key lock --- KeyDoorShuffle.py | 14 +++----------- Main.py | 2 +- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/KeyDoorShuffle.py b/KeyDoorShuffle.py index 9c3d07eb..4d82d257 100644 --- a/KeyDoorShuffle.py +++ b/KeyDoorShuffle.py @@ -705,7 +705,7 @@ def unique_doors(doors): def count_unique_sm_doors(doors): unique_d_set = set() for d in doors: - if d not in unique_d_set and d.dest not in unique_d_set and not d.bigKey: + if d not in unique_d_set and (d.dest not in unique_d_set or d.type == DoorType.SpiralStairs) and not d.bigKey: unique_d_set.add(d) return len(unique_d_set) @@ -718,7 +718,8 @@ def count_unique_small_doors(key_counter, proposal): if door in proposal and door not in counted: cnt += 1 counted.add(door) - counted.add(door.dest) + if door.type != DoorType.SpiralStairs: + counted.add(door.dest) return cnt @@ -1069,15 +1070,6 @@ def invalid_self_locking_key(state, prev_state, prev_avail, world, player): return prev_avail - 1 == 0 -# does not allow dest doors -def count_unique_sm_doors(doors): - unique_d_set = set() - for d in doors: - if d not in unique_d_set and d.dest not in unique_d_set and not d.bigKey: - unique_d_set.add(d) - return len(unique_d_set) - - def enough_small_locations(state, avail_small_loc): unique_d_set = set() for exp_door in state.small_doors: diff --git a/Main.py b/Main.py index a062eab3..255a4290 100644 --- a/Main.py +++ b/Main.py @@ -24,7 +24,7 @@ from Fill import distribute_items_cutoff, distribute_items_staleness, distribute from ItemList import generate_itempool, difficulties, fill_prizes from Utils import output_path, parse_player_names -__version__ = '0.0.18.1d' +__version__ = '0.0.18.2d' def main(args, seed=None):