drop onGameTick20 - it has some savings on cpu, but racers demand millisecond precision not 20 millisecond, apparently
authornemo
Wed, 30 Oct 2013 15:54:29 -0400
changeset 9659 e9c00dd31b07
parent 9658 c97e8ecc7457
child 9660 267c0005baaf
drop onGameTick20 - it has some savings on cpu, but racers demand millisecond precision not 20 millisecond, apparently
share/hedgewars/Data/Maps/TrophyRace/map.lua
--- a/share/hedgewars/Data/Maps/TrophyRace/map.lua	Wed Oct 30 15:25:17 2013 -0400
+++ b/share/hedgewars/Data/Maps/TrophyRace/map.lua	Wed Oct 30 15:54:29 2013 -0400
@@ -72,17 +72,17 @@
     SetAmmo(amRope, 9, 2, 0)
 end
 
-function onGameTick20()
+function onGameTick()
     if startTime == 0 and TurnTimeLeft < maxtime then
         startTime = GameTime
     end
-    if CurrentHedgehog ~= nil and TurnTimeLeft <= 20 and TurnTimeLeft > 0 then
+    if CurrentHedgehog ~= nil and TurnTimeLeft == 0 then
         SetHealth(CurrentHedgehog, 0)
         x, y = GetGearPosition(CurrentHedgehog)
         AddGear(x, y, gtShell, 0, 0, 0, 0)
         worsttime = 99999
         worsthog = nil
-    elseif TurnTimeLeft > maxtime - 25 and CurrentHedgehog ~= nil then
+    elseif TurnTimeLeft == maxtime-1 and CurrentHedgehog ~= nil then
         if lasthog ~= nil then 
         SetGearPosition(lasthog, p , 0)
         end