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:
parent
1df7331b66
commit
2a3af50400
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue