Protect Unit Micro AI: fix bug in goal selection
There was a typo in the goal table indexing. It worked for the multi-unit test scenario (the Elves Besieged) because the goal x coordinates for both units were the same.
This commit is contained in:
parent
cce0dcba9d
commit
04bf7c56e0
1 changed files with 1 additions and 1 deletions
|
@ -51,7 +51,7 @@ function ca_protect_unit_move:execution(ai, cfg, self)
|
|||
-- Also need the goal for this unit
|
||||
local goal = {}
|
||||
for i,id in ipairs(cfg.id) do
|
||||
if (unit.id == id) then goal = { cfg.goal_x[1], cfg.goal_y[i] } end
|
||||
if (unit.id == id) then goal = { cfg.goal_x[i], cfg.goal_y[i] } end
|
||||
end
|
||||
--print("Goal:",goal[1],goal[2])
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue