Skip to content

Commit

Permalink
Herding Micro AI: fix variables not being local
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsc committed Oct 6, 2019
1 parent 882ba31 commit f77dbe4
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 = -9e99
local max_rating, best_dog, best_enemy, best_hex = -9e99
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 = -9e99
local max_rating, best_dog, best_hex = -9e99
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 f77dbe4

Please sign in to comment.