Temporarily fix issue with Customizer+Grouped OWR
This commit is contained in:
@@ -690,33 +690,33 @@ def shuffle_tiles(world, groups, result_list, do_grouped, player):
|
|||||||
if world.customizer:
|
if world.customizer:
|
||||||
if not do_grouped:
|
if not do_grouped:
|
||||||
custom_flips = world.customizer.get_owtileflips()
|
custom_flips = world.customizer.get_owtileflips()
|
||||||
if custom_flips and player in custom_flips:
|
if custom_flips and player in custom_flips:
|
||||||
custom_flips = custom_flips[player]
|
custom_flips = custom_flips[player]
|
||||||
nonflipped_groups = list()
|
nonflipped_groups = list()
|
||||||
forced_flips = list()
|
forced_flips = list()
|
||||||
forced_nonflips = list()
|
forced_nonflips = list()
|
||||||
if 'undefined_chance' in custom_flips:
|
if 'undefined_chance' in custom_flips:
|
||||||
undefined_chance = custom_flips['undefined_chance']
|
undefined_chance = custom_flips['undefined_chance']
|
||||||
if 'force_flip' in custom_flips:
|
if 'force_flip' in custom_flips:
|
||||||
forced_flips = custom_flips['force_flip']
|
forced_flips = custom_flips['force_flip']
|
||||||
if 'force_no_flip' in custom_flips:
|
if 'force_no_flip' in custom_flips:
|
||||||
forced_nonflips = custom_flips['force_no_flip']
|
forced_nonflips = custom_flips['force_no_flip']
|
||||||
|
|
||||||
for group in groups:
|
for group in groups:
|
||||||
if any(owid in group[0] for owid in forced_nonflips):
|
if any(owid in group[0] for owid in forced_nonflips):
|
||||||
nonflipped_groups.append(group)
|
nonflipped_groups.append(group)
|
||||||
if any(owid in group[0] for owid in forced_flips):
|
if any(owid in group[0] for owid in forced_flips):
|
||||||
flipped_groups.append(group)
|
flipped_groups.append(group)
|
||||||
|
|
||||||
# Check if there are any groups that appear in both sets
|
# Check if there are any groups that appear in both sets
|
||||||
if any(group in flipped_groups for group in nonflipped_groups):
|
if any(group in flipped_groups for group in nonflipped_groups):
|
||||||
raise GenerationException('Conflict found when flipping tiles')
|
raise GenerationException('Conflict found when flipping tiles')
|
||||||
|
|
||||||
for g in nonflipped_groups:
|
for g in nonflipped_groups:
|
||||||
always_removed.append(g)
|
|
||||||
if undefined_chance == 0:
|
|
||||||
for g in [g for g in groups if g not in flipped_groups + always_removed]:
|
|
||||||
always_removed.append(g)
|
always_removed.append(g)
|
||||||
|
if undefined_chance == 0:
|
||||||
|
for g in [g for g in groups if g not in flipped_groups + always_removed]:
|
||||||
|
always_removed.append(g)
|
||||||
|
|
||||||
attempts = 1
|
attempts = 1
|
||||||
if 0 < undefined_chance < 100:
|
if 0 < undefined_chance < 100:
|
||||||
|
|||||||
Reference in New Issue
Block a user