battle_calcs.lua: fix bug in get_attack_map_unit() for enemy units

Own units with MP left need to be taken off the map before enemy path
finding, not just added to the table.
This commit is contained in:
mattsc 2014-04-23 18:48:39 -07:00
parent 1df7331b66
commit 2a3af50400

View file

@ -1133,7 +1133,10 @@ function battle_calcs.get_attack_map_unit(unit, cfg)
if (unit.side ~= wesnoth.current.side) then
local all_units = wesnoth.get_units { side = wesnoth.current.side }
for _,unit in ipairs(all_units) do
if (unit.moves > 0) then table.insert(units_MP, unit) end
if (unit.moves > 0) then
table.insert(units_MP, unit)
wesnoth.extract_unit(unit)
end
end
end