Skip to content

Commit

Permalink
Herding Micro AI: fix variabls not being local
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsc committed Aug 30, 2018
1 parent cb423b2 commit 80ae232
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data/ai/micro_ais/cas/ca_herding_attack_close_enemy.lua
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 80ae232

Please sign in to comment.