blue fix
This commit is contained in:
@@ -136,7 +136,24 @@ def evaluate_blueprints(conn):
|
|||||||
continue
|
continue
|
||||||
has_max = b_info.get('has_max_level', False)
|
has_max = b_info.get('has_max_level', False)
|
||||||
deps = b_info.get('missing_dependencies')
|
deps = b_info.get('missing_dependencies')
|
||||||
|
|
||||||
|
# Do not trust the frontend 'enough_resources' flag. Grepolis lazily loads this,
|
||||||
|
# so for background towns it is almost always stale (False). We calculate it manually!
|
||||||
enough = b_info.get('enough_resources')
|
enough = b_info.get('enough_resources')
|
||||||
|
res = town.get('resources')
|
||||||
|
if res:
|
||||||
|
b_wood = b_info.get('wood', 0)
|
||||||
|
b_stone = b_info.get('stone', 0)
|
||||||
|
b_iron = b_info.get('iron', 0)
|
||||||
|
b_pop = b_info.get('pop', 0)
|
||||||
|
|
||||||
|
enough = (
|
||||||
|
res.get('wood', 0) >= b_wood and
|
||||||
|
res.get('stone', 0) >= b_stone and
|
||||||
|
res.get('iron', 0) >= b_iron and
|
||||||
|
res.get('population', 0) >= b_pop
|
||||||
|
)
|
||||||
|
|
||||||
log.warning(f"[blueprint] {b_name}: has_max={has_max}, deps={deps}, enough_resources={enough}")
|
log.warning(f"[blueprint] {b_name}: has_max={has_max}, deps={deps}, enough_resources={enough}")
|
||||||
|
|
||||||
if not has_max:
|
if not has_max:
|
||||||
|
|||||||
Reference in New Issue
Block a user