diff -r e28b534188d3 -r 67049c8dedd1 share/hedgewars/Data/Scripts/Tracker.lua --- a/share/hedgewars/Data/Scripts/Tracker.lua Tue Apr 26 18:15:10 2016 +0200 +++ b/share/hedgewars/Data/Scripts/Tracker.lua Tue Apr 26 20:51:13 2016 +0200 @@ -243,6 +243,18 @@ end end +-- Returns the first hog (alive or not) in the given clan +function getFirstHogOfClan(clan) + for k, hogs in pairs(teams) do + for m, hog in ipairs(hogs) do + if GetHogClan(hog) == clan then + return hog + end + end + end + return nil +end + -- Run a function on all tracked hogs function runOnHogs(func) for k, hogs in pairs(teams) do