From 8f7ebc46b2880fc7b4b796e2303e1a8428255b00 Mon Sep 17 00:00:00 2001 From: Catobat <69204835+Catobat@users.noreply.github.com> Date: Mon, 20 May 2024 18:20:05 +0200 Subject: [PATCH] Fix edge cases with undefined_chance --- OverworldShuffle.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/OverworldShuffle.py b/OverworldShuffle.py index 5430e175..c0d17a1e 100644 --- a/OverworldShuffle.py +++ b/OverworldShuffle.py @@ -1049,9 +1049,13 @@ def shuffle_tiles(world, groups, result_list, do_grouped, forced_flips, player): # tile shuffle happens here removed = [] - if 0 < undefined_chance < 100: - for group in groups: - if group[0] in nonflipped_groups or (group[0] not in flipped_groups and random.randint(1, 100) > undefined_chance): + for group in groups: + if group[0] in nonflipped_groups: + removed.append(group) + else: + if group[0] in flipped_groups or undefined_chance >= 100: + continue + if undefined_chance == 0 or random.randint(1, 100) > undefined_chance: removed.append(group) # save shuffled tiles to list