stricter skip
authornemo
Sun, 30 Nov 2014 16:06:39 -0500
changeset 10592 2da35f88db23
parent 10591 9a9f0cbb10b2
child 10593 7d41b0446706
stricter skip
share/hedgewars/Data/Maps/ClimbHome/map.lua
--- a/share/hedgewars/Data/Maps/ClimbHome/map.lua	Sun Nov 30 23:36:22 2014 +0300
+++ b/share/hedgewars/Data/Maps/ClimbHome/map.lua	Sun Nov 30 16:06:39 2014 -0500
@@ -32,6 +32,7 @@
 local ready = false
 local showWaterStats = false -- uses the AI team to draw water height.
 local dummyHog = nil
+local dummySkip = 0
 
 function onGameInit()
     -- Ensure people get same map for same theme
@@ -109,13 +110,17 @@
     YouLost = false
     tauntNoo = false
     recordBroken = false
-    if CurrentHedgehog ~= nil and CurrentHedgehog ~= dummyHog then
-        SetGearPosition(CurrentHedgehog, 1951,32640)
-        if not HogsAreInvulnerable then SetEffect(CurrentHedgehog,heInvulnerable,0) end
-        AddVisualGear(19531,32640,vgtExplosion,0,false)
-        SetState(CurrentHedgehog,band(GetState(CurrentHedgehog),bnot(gstInvisible)))
-        SetWeapon(amRope)
-        ready = true
+    if CurrentHedgehog ~= nil then
+        if CurrentHedgehog ~= dummyHog then
+            SetGearPosition(CurrentHedgehog, 1951,32640)
+            if not HogsAreInvulnerable then SetEffect(CurrentHedgehog,heInvulnerable,0) end
+            AddVisualGear(19531,32640,vgtExplosion,0,false)
+            SetState(CurrentHedgehog,band(GetState(CurrentHedgehog),bnot(gstInvisible)))
+            SetWeapon(amRope)
+            ready = true
+        else
+            dummySkip = GameTime+1
+        end
     end
     for f,i in pairs(Fire) do
         DeleteGear(f)
@@ -171,8 +176,9 @@
 function onGameTick20()
     local x,y;
     if math.random(20) == 1 then AddVisualGear(2012,56,vgtSmoke,0,false) end
-    if CurrentHedgehog == dummyHog then
+    if CurrentHedgehog == dummyHog and dummySkip ~= 0 and dummySkip < GameTime then
         ParseCommand("/skip")
+        dummySkip = 0
     end
 
     --if BoomFire ~= nil then