Lua API: Fix wesnoth.map.find(filter, unit) ignoring the unit

This commit is contained in:
Celtic Minstrel 2021-07-26 02:26:46 -04:00 committed by Celtic Minstrel
parent 8590a2bd70
commit cba14eb5c4

View file

@ -191,8 +191,8 @@ if wesnoth.kernel_type() == "Game Lua Kernel" then
end
local find_locations = wesnoth.map.find
function wesnoth.map.find(cfg)
local hexes = find_locations(cfg)
function wesnoth.map.find(cfg, ref_unit)
local hexes = find_locations(cfg, ref_unit)
for i = 1, #hexes do
hexes[i] = wesnoth.map.get(hexes[i][1], hexes[i][2])
end