wesnoth.units.find_attack: also return attack index

This commit is contained in:
mattsc 2019-12-19 07:05:10 -08:00
parent a6d3ecaee4
commit a1de3a0d72

View File

@ -576,7 +576,7 @@ if wesnoth.kernel_type() == "Game Lua Kernel" then
function wesnoth.units.find_attack(unit, filter)
for i, atk in ipairs(unit.attacks) do
if atk:matches(filter) then return atk end
if atk:matches(filter) then return atk, i end
end
end