From fd424496bb978642921e802791c265f094458e11 Mon Sep 17 00:00:00 2001 From: Thefeli73 Date: Wed, 7 Oct 2020 19:15:31 +0200 Subject: [PATCH] tilescore check effect properly --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 55771fe..fd80cbf 100644 --- a/main.py +++ b/main.py @@ -326,7 +326,7 @@ def chart_map(): optimize_available_tiles() -def tile_score(tile, radius): +def tile_score(tile, radius, effect): global state affected_people = 0 affected_buildings = 0 @@ -335,7 +335,7 @@ def tile_score(tile, radius): delta_x = abs(tile[0] - residence.X) delta_y = abs(tile[1] - residence.Y) distance = delta_x + delta_y - if (distance <= radius) and not ("Park", "WindTurbine", "Mall.2" in residence.effects): + if (distance <= radius) and not effect in residence.effects: affected_people += residence.current_pop affected_buildings += 1 return affected_people, affected_buildings