From 383a2a274de253f4936e919bd3da076875a94168 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Fri, 29 Jul 2022 21:33:10 -0500 Subject: [PATCH] Catching infinite loop at balance_money_progression --- Fill.py | 5 +++++ 1 file changed, 5 insertions(+) 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)