From c475dc746c6caf289888906ba114adeb3e6f9ff3 Mon Sep 17 00:00:00 2001 From: aerinon Date: Fri, 3 Jan 2020 07:22:22 -0700 Subject: [PATCH] Better polarity match --- DungeonGenerator.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/DungeonGenerator.py b/DungeonGenerator.py index 95eebb40..5b50123b 100644 --- a/DungeonGenerator.py +++ b/DungeonGenerator.py @@ -1480,9 +1480,12 @@ def valid_polarized_assignment(builder, sector_list): others = [x for x in full_list if x != sector] other_mag = sum_magnitude(others) sector_mag = sector.magnitude() + hookable = False for i in range(len(sector_mag)): - if sector_mag[i] > 0 and other_mag[i] == 0: - return False + if sector_mag[i] > 0 and other_mag[i] > 0: + hookable = True + if not hookable: + return False # dead_ends = 0 # branches = 0 # for sector in sector_list: