From a1de3a0d72439b73e348eee12916524e21a5b1c5 Mon Sep 17 00:00:00 2001 From: mattsc Date: Thu, 19 Dec 2019 07:05:10 -0800 Subject: [PATCH] wesnoth.units.find_attack: also return attack index --- data/lua/core.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/lua/core.lua b/data/lua/core.lua index 57408d979d1..9463d7dbe78 100644 --- a/data/lua/core.lua +++ b/data/lua/core.lua @@ -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