From 49e799f658a2e034c2d8a7f4f1602f304b531626 Mon Sep 17 00:00:00 2001 From: aerinon Date: Mon, 17 Aug 2020 11:23:12 -0600 Subject: [PATCH] Fixed two minor bugs --- DungeonGenerator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DungeonGenerator.py b/DungeonGenerator.py index 6aa16c31..84c42a86 100644 --- a/DungeonGenerator.py +++ b/DungeonGenerator.py @@ -1851,10 +1851,10 @@ def assign_polarized_sectors(dungeon_map, polarized_sectors, global_pole, builde valid, choice = False, None while not valid: if len(best_candidates) == 0: + if len(candidates) == 0: + raise GenerationException('Cross Dungeon Builder: Simple branch problems: %s' % name) best = min(charges) - best_candidates = [x for i, x in candidates if charges[i] <= best] - if len(candidates) == 0: - raise GenerationException('Cross Dungeon Builder: Simple branch problems: %s' % name) + best_candidates = [x for i, x in enumerate(candidates) if charges[i] <= best] choice = random.choice(best_candidates) best_candidates.remove(choice) i = candidates.index(choice)