ai_helper.get_dst_src(units): minor code simplification

This commit is contained in:
mattsc 2013-11-14 19:06:50 -08:00
parent 5f39a7d2dc
commit 71f92aa05c

View file

@ -696,17 +696,13 @@ function ai_helper.get_dst_src_units(units, cfg)
end
function ai_helper.get_dst_src(units)
-- Produces the same output as ai.get_dst_src() (available in 1.11.0)
-- If units is given, use them, otherwise do it for all units on the current side
-- If 'units' table is given, use it, otherwise use all units on the current side
local my_units = {}
if units then
my_units = units
else
my_units = wesnoth.get_units { side = wesnoth.current.side }
if (not units) then
units = wesnoth.get_units { side = wesnoth.current.side }
end
return ai_helper.get_dst_src_units(my_units)
return ai_helper.get_dst_src_units(units)
end
function ai_helper.get_enemy_dst_src(enemies)