--- a/share/hedgewars/Data/Scripts/Tracker.lua Sun Nov 18 21:01:16 2018 +0100
+++ b/share/hedgewars/Data/Scripts/Tracker.lua Mon Nov 19 00:19:21 2018 +0100
@@ -34,7 +34,7 @@
if trackingTeams and GetGearType(gear) == gtHedgehog then
hogs = teams[GetHogTeamName(gear)]
if hogs ~= nil then
- if table.maxn(hogs) == 1 then
+ if #hogs == 1 then
hogs = nil
else
for k, hog in ipairs(hogs) do
@@ -89,7 +89,7 @@
hogs = teams[GetHogTeamName(gear)]
if hogs ~= nil then
- if table.maxn(hogs) == 1 then
+ if #hogs == 1 then
hogs = nil
else
for k, hog in ipairs(hogs) do
@@ -286,7 +286,7 @@
-- Run a function on hogs in a clan
function runOnHogsInClan(func, clan)
- for i = 1, table.maxn(clans) do
+ for i = 1, ClansCount do
if clans[i] == clan then
for k, hog in ipairs(teams[i]) do
func(hog)
@@ -297,7 +297,7 @@
-- Run a function on hogs in other clans
function runOnHogsInOtherClans(func, clan)
- for i = 1, table.maxn(clans) do
+ for i = 1, ClansCount do
if clans[i] ~= clan then
for k, hog in ipairs(teams[i]) do
func(hog)