From f5f694df3ee668601a64228b7e9ec0d221e8942d Mon Sep 17 00:00:00 2001 From: Thefeli73 Date: Sun, 4 Oct 2020 17:52:27 +0200 Subject: [PATCH] construct utility buildings fix --- main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 59625a4..5a29db8 100644 --- a/main.py +++ b/main.py @@ -256,8 +256,10 @@ def something_needs_attention(): adjustEnergy(state.residences[edit_temp[1]]) return True elif building_under_construction is not None: #finish construction - print(building_under_construction) - if game_layer.game_state.residences[building_under_construction[2]].build_progress < 100: # TODO: inte ba kolla residence utan ocksÄ utility + if (len(game_layer.game_state.residences) >= building_under_construction[2]) and (game_layer.game_state.residences[building_under_construction[2]].build_progress < 100): + game_layer.build((building_under_construction[0], building_under_construction[1])) + return True + elif (len(game_layer.game_state.utilities)-1 >= building_under_construction[2]) and (game_layer.game_state.utilities[building_under_construction[2]].build_progress < 100): game_layer.build((building_under_construction[0], building_under_construction[1])) return True else: