mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-29 13:33:18 +00:00
wesnoth.units.find_attack: also return attack index
This commit is contained in:
parent
a6d3ecaee4
commit
a1de3a0d72
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user