From 638ebcfd721846ed78aebd7283417368bf5201f6 Mon Sep 17 00:00:00 2001 From: Thefeli73 Date: Mon, 5 Oct 2020 21:35:34 +0200 Subject: [PATCH] change energy return (wasted wait()) --- main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 8efcbc8..c8af3d4 100644 --- a/main.py +++ b/main.py @@ -160,9 +160,8 @@ def something_needs_attention(): game_layer.maintenance((state.residences[maintain[1]].X, state.residences[maintain[1]].Y)) return True elif edit_temp[0]: # adjust temp of buildings - adjustEnergy(state.residences[edit_temp[1]]) - return True - elif building_under_construction is not None: #finish construction + return adjust_energy(state.residences[edit_temp[1]]) + elif building_under_construction is not None: # finish construction if (len(state.residences)-1 >= building_under_construction[2]) and (state.residences[building_under_construction[2]].build_progress < 100): game_layer.build((building_under_construction[0], building_under_construction[1])) if not state.residences[building_under_construction[2]].build_progress < 100: @@ -199,11 +198,12 @@ def adjust_energy(current_building): if effectiveEnergyIn > blueprint.base_energy_need: game_layer.adjust_energy_level((current_building.X, current_building.Y), effectiveEnergyIn) + return True elif effectiveEnergyIn < blueprint.base_energy_need: game_layer.adjust_energy_level((current_building.X, current_building.Y), blueprint.base_energy_need + 0.01) + return True else: - print("you did it!") - game_layer.wait() + return False def optimize_available_tiles():