share/hedgewars/Data/Scripts/Tracker.lua
changeset 14236 74bf2d906097
parent 14235 8edbdd3a1fe7
--- a/share/hedgewars/Data/Scripts/Tracker.lua	Mon Nov 19 00:19:21 2018 +0100
+++ b/share/hedgewars/Data/Scripts/Tracker.lua	Mon Nov 19 00:54:36 2018 +0100
@@ -32,12 +32,12 @@
         end
     end
     if trackingTeams and GetGearType(gear) == gtHedgehog then
-    	hogs = teams[GetHogTeamName(gear)]
+        local hogs = teams[GetHogTeamName(gear)]
         if hogs ~= nil then
             if #hogs == 1 then
                 hogs = nil
             else
-				for k, hog in ipairs(hogs) do
+                for k, hog in ipairs(hogs) do
                     if hog == gear then
                         table.remove(hogs, k)
                         break
@@ -47,7 +47,7 @@
         end
     elseif resurrecting and GetGearType(gear) == gtResurrector then
         for k, gear in ipairs(resurrectedHogs) do
-            team = GetHogTeamName(gear)
+            local team = GetHogTeamName(gear)
             if teams[team] == nil then
                 teams[team] = {}
             end
@@ -64,7 +64,7 @@
         trackingTeams = true
         for k, gear in ipairs(gears) do
             if GetGearType(gear) == gtHedgehog then
-                team = GetHogTeamName(gear)
+                local team = GetHogTeamName(gear)
                 if teams[team] == nil then
                     teams[team] = { gear }
                     clans[team] = GetHogClan(gear)
@@ -84,10 +84,10 @@
             break
         end
     end
-	
+
     if trackingTeams then
-    	hogs = teams[GetHogTeamName(gear)]
-    	
+        local hogs = teams[GetHogTeamName(gear)]
+
         if hogs ~= nil then
             if #hogs == 1 then
                 hogs = nil
@@ -105,10 +105,10 @@
 
 -- Registers when a hog is restored
 function trackRestoring(gear)
-	table.insert(gears, gear)
+    table.insert(gears, gear)
 
     if trackingTeams then
-        team = GetHogTeamName(gear)
+        local team = GetHogTeamName(gear)
         if teams[team] == nil then
             teams[team] = {}
         end
@@ -126,7 +126,7 @@
 
 -- Set a value for a specific gear
 function setGearValue(gear, key, value)
-    found = false
+    local found = false
     for id, values in pairs(gearValues) do
         if id == gear then
             values[key] = value
@@ -166,7 +166,7 @@
 
 -- Set a value for a specific team
 function setTeamValue(team, key, value)
-    found = false
+    local found = false
     for name, values in pairs(teamValues) do
         if name == team then
             values[key] = value
@@ -206,7 +206,7 @@
 
 -- Set a value for a specific clan
 function setClanValue(clan, key, value)
-    found = false
+    local found = false
     for num, values in ipairs(clanValues) do
         if num == clan then
             values[key] = value