Fix edge cases with undefined_chance

This commit is contained in:
Catobat
2024-05-20 18:20:05 +02:00
parent 8b295a74ad
commit 8f7ebc46b2

View File

@@ -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):
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