Catching infinite loop at balance_money_progression

This commit is contained in:
codemann8
2022-07-29 21:33:10 -05:00
parent a36d65ef81
commit 383a2a274d

View File

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