Lua AIs: Remove unnecessary arguments in call to wesnoth.put_unit()
This commit is contained in:
parent
fa6ff01faf
commit
c6db6cd8d5
4 changed files with 5 additions and 5 deletions
|
@ -1199,7 +1199,7 @@ function battle_calcs.get_attack_map_unit(unit, cfg)
|
|||
|
||||
-- Put the units back out there
|
||||
if (unit.side ~= wesnoth.current.side) then
|
||||
for iu,uMP in ipairs(units_MP) do wesnoth.put_unit(uMP.x, uMP.y, uMP) end
|
||||
for iu,uMP in ipairs(units_MP) do wesnoth.put_unit(uMP) end
|
||||
end
|
||||
|
||||
for i,loc in ipairs(initial_reach) do
|
||||
|
@ -1352,7 +1352,7 @@ function battle_calcs.best_defense_map(units, cfg)
|
|||
end
|
||||
|
||||
if cfg.ignore_these_units then
|
||||
for i,u in ipairs(cfg.ignore_these_units) do wesnoth.put_unit(u.x, u.y, u) end
|
||||
for i,u in ipairs(cfg.ignore_these_units) do wesnoth.put_unit(u) end
|
||||
end
|
||||
|
||||
return defense_map
|
||||
|
|
|
@ -143,7 +143,7 @@ function ca_goto:execution(ai, cfg, self)
|
|||
end
|
||||
path, cost = wesnoth.find_path(u, l[1], l[2], { ignore_units = cfg.ignore_units })
|
||||
if enemy_at_goal then
|
||||
wesnoth.put_unit(enemy_at_goal.x, enemy_at_goal.y, enemy_at_goal)
|
||||
wesnoth.put_unit(enemy_at_goal)
|
||||
--- Give massive penalty for this goal hex
|
||||
cost = cost + 100
|
||||
end
|
||||
|
|
|
@ -68,7 +68,7 @@ function ca_healer_move:evaluation(ai, cfg, self)
|
|||
local avoid_map = LS.of_pairs(ai.get_avoid())
|
||||
|
||||
-- Put units back out there
|
||||
for i,u in ipairs(units_MP) do wesnoth.put_unit(u.x, u.y, u) end
|
||||
for i,u in ipairs(units_MP) do wesnoth.put_unit(u) end
|
||||
|
||||
-- Now find the best healer move
|
||||
local max_rating, best_hex = -9e99, {}
|
||||
|
|
|
@ -43,7 +43,7 @@ function ca_protect_unit_move:execution(ai, cfg, self)
|
|||
--AH.put_labels(EAM)
|
||||
|
||||
-- Now put the units back out there
|
||||
for i,u in ipairs(units) do wesnoth.put_unit(u.x, u.y, u) end
|
||||
for i,u in ipairs(units) do wesnoth.put_unit(u) end
|
||||
|
||||
-- We move the weakest (fewest HP unit) first
|
||||
local unit = AH.choose(units, function(tmp) return -tmp.hitpoints end)
|
||||
|
|
Loading…
Add table
Reference in a new issue