diff --git a/data/ai/lua/battle_calcs.lua b/data/ai/lua/battle_calcs.lua index 746dfcc8c07..45774c4750f 100644 --- a/data/ai/lua/battle_calcs.lua +++ b/data/ai/lua/battle_calcs.lua @@ -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 diff --git a/data/ai/micro_ais/cas/ca_goto.lua b/data/ai/micro_ais/cas/ca_goto.lua index 999578e95fa..547ee7b2015 100644 --- a/data/ai/micro_ais/cas/ca_goto.lua +++ b/data/ai/micro_ais/cas/ca_goto.lua @@ -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 diff --git a/data/ai/micro_ais/cas/ca_healer_move.lua b/data/ai/micro_ais/cas/ca_healer_move.lua index c1a6dbecb04..f4942f812f1 100644 --- a/data/ai/micro_ais/cas/ca_healer_move.lua +++ b/data/ai/micro_ais/cas/ca_healer_move.lua @@ -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, {} diff --git a/data/ai/micro_ais/cas/ca_protect_unit_move.lua b/data/ai/micro_ais/cas/ca_protect_unit_move.lua index d8a8a624c7d..98f2f7420c6 100644 --- a/data/ai/micro_ais/cas/ca_protect_unit_move.lua +++ b/data/ai/micro_ais/cas/ca_protect_unit_move.lua @@ -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)