share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua
changeset 11992 c3c7c036c521
parent 11991 5a51bca7eeaa
child 11993 b061f4bae002
--- a/share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua	Sat Apr 09 05:28:18 2016 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua	Sat Apr 09 06:09:59 2016 +0200
@@ -1849,7 +1849,7 @@
 
 	--this is a quick hack so that the human team(s) will always be
 	--given the first move ahead of the AI
-	tempDataList = {}
+	local tempDataList = {}
 	if GetHogLevel(gear) == 0 then
 		tempDataList = hogDataList
 	else
@@ -1865,7 +1865,7 @@
 
 		-- try match team colour to the colours recorded in the colour array
 
-		tColor = 0x00000000
+		local tColor = 0x00000000
 		for i = 1, #colorArray do
 			if GetClanColor(GetHogClan(gear)) == colorArray[i][1] then
 				tColor = colorArray[i][2]
@@ -1956,6 +1956,13 @@
 -- output hog and team data to the console
 function SaveHogData()
 
+	teamCounter = 0
+	lastRecordedTeam = ""
+	hhs = {}
+	shoppaPointList = {}
+	hogDataList = {}
+	AIHogDataList = {}
+
 	runOnHogs(GetDataForSavingHogs)
 
 	WriteLnToConsole("	------ TEAM LIST ------")
@@ -2058,9 +2065,9 @@
 -- distinction betweeen the need to track victory/win conditions or not
 function GetDataForGearSaving(gear)
 
-	temp = nil
-	specialFlag = nil
-	arrayList = nil
+	local temp = nil
+	local specialFlag = nil
+	local arrayList = nil
 
 	if GetGearType(gear) == gtMine then