tilescore check effect properly
This commit is contained in:
parent
96633a9e98
commit
fd424496bb
4
main.py
4
main.py
@ -326,7 +326,7 @@ def chart_map():
|
|||||||
optimize_available_tiles()
|
optimize_available_tiles()
|
||||||
|
|
||||||
|
|
||||||
def tile_score(tile, radius):
|
def tile_score(tile, radius, effect):
|
||||||
global state
|
global state
|
||||||
affected_people = 0
|
affected_people = 0
|
||||||
affected_buildings = 0
|
affected_buildings = 0
|
||||||
@ -335,7 +335,7 @@ def tile_score(tile, radius):
|
|||||||
delta_x = abs(tile[0] - residence.X)
|
delta_x = abs(tile[0] - residence.X)
|
||||||
delta_y = abs(tile[1] - residence.Y)
|
delta_y = abs(tile[1] - residence.Y)
|
||||||
distance = delta_x + delta_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_people += residence.current_pop
|
||||||
affected_buildings += 1
|
affected_buildings += 1
|
||||||
return affected_people, affected_buildings
|
return affected_people, affected_buildings
|
||||||
|
Reference in New Issue
Block a user