Herding Micro AI: fix variabls not being local
(cherry-picked from commit 80ae232935
)
This commit is contained in:
parent
37e83f1262
commit
3c558c7360
1 changed files with 2 additions and 2 deletions
|
@ -48,7 +48,7 @@ function ca_herding_attack_close_enemy:execution(cfg)
|
|||
local radius = cfg.attack_distance or 4
|
||||
local enemies = get_enemies(cfg, radius)
|
||||
|
||||
max_rating, best_dog, best_enemy, best_hex = - math.huge
|
||||
local max_rating, best_dog, best_enemy, best_hex = - math.huge
|
||||
for _,enemy in ipairs(enemies) do
|
||||
for _,dog in ipairs(dogs) do
|
||||
local reach_map = AH.get_reachable_unocc(dog)
|
||||
|
@ -102,7 +102,7 @@ function ca_herding_attack_close_enemy:execution(cfg)
|
|||
end
|
||||
|
||||
-- Move dogs in between enemies and sheep
|
||||
max_rating, best_dog, best_hex = - math.huge
|
||||
local max_rating, best_dog, best_hex = - math.huge
|
||||
for _,dog in ipairs(dogs) do
|
||||
local reach_map = AH.get_reachable_unocc(dog)
|
||||
reach_map:iter( function(x, y, v)
|
||||
|
|
Loading…
Add table
Reference in a new issue