share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua
changeset 13220 bc95df84395f
parent 13032 625d5a45f267
child 13287 b13071610c07
--- a/share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua	Thu Mar 15 02:59:37 2018 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua	Thu Mar 15 03:29:31 2018 +0100
@@ -81,6 +81,7 @@
 HedgewarsScriptLoad("/Scripts/OfficialChallenges.lua")
 HedgewarsScriptLoad("/Scripts/Tracker.lua")
 HedgewarsScriptLoad("/Scripts/Params.lua")
+HedgewarsScriptLoad("/Scripts/Utils.lua")
 HedgewarsScriptLoad("/Scripts/TechMaps.lua")
 
 ------------------
@@ -793,30 +794,36 @@
 end
 
 function onGameInit()
+
+    TemplateFilter = 0
+
+    if MapGen == mgDrawn then
+        eraseMap(false)
+    else
+        MapGen = mgDrawn
+    end
+
     if mapID == nil then
         mapID = 2 + GetRandom(7)
     end
 
     addHashData(mapID)
 
-		Theme = "Cave"
-		Map = ""
-
-		MapGen = mgDrawn
-		TemplateFilter = 0
+    Theme = "Cave"
+    Map = ""
 
-		EnableGameFlags(gfInfAttack, gfDisableWind, gfBorder)
-		DisableGameFlags(gfSolidLand)
-		CaseFreq = 0
-        TurnTime = 90000
-        WaterRise = 0
-        HealthDecrease = 0
+    EnableGameFlags(gfInfAttack, gfDisableWind, gfBorder)
+    DisableGameFlags(gfSolidLand)
+    CaseFreq = 0
+    TurnTime = 90000
+    WaterRise = 0
+    HealthDecrease = 0
 
-		for x = 1, 16 do
-			AddPoint(x*100,100,5)
-		end
+    for x = 1, 16 do
+        AddPoint(x*100,100,5)
+    end
 
-		FlushPoints()
+    FlushPoints()
 
 end