diff --git a/Fill.py b/Fill.py index 75637093..daa6f6bd 100644 --- a/Fill.py +++ b/Fill.py @@ -830,7 +830,12 @@ def balance_money_progression(world): return False done = False + attempts = world.players * 20 + 20 while not done: + attempts -= 1 + if attempts < 0: + from DungeonGenerator import GenerationException + raise GenerationException(f'Infinite loop detected at "balance_money_progression"') sphere_costs = {player: 0 for player in range(1, world.players+1)} locked_by_money = {player: set() for player in range(1, world.players+1)} sphere_locations = get_sphere_locations(state, unchecked_locations)