# HG changeset patch
# User nemo
# Date 1383507907 18000
# Node ID 8663d299ba62517d5c65648c4d3d0ed9bbcf86d8
# Parent  1954f692e8c61e1617dac2ac0a307c7207accfdd
this should prevent sliding when game clock isn't running.  sorry unc0rr, not going to bother encapsulating. maybe later.  short on time right now/lazy

diff -r 1954f692e8c6 -r 8663d299ba62 hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Sun Nov 03 22:39:00 2013 +0400
+++ b/hedgewars/uGears.pas	Sun Nov 03 14:45:07 2013 -0500
@@ -167,7 +167,9 @@
 var t: PGear;
     i, AliveCount: LongInt;
     s: shortstring;
+    prevtime: LongWord;
 begin
+prevtime:= TurnTimeLeft;
 ScriptCall('onGameTick');
 if GameTicks mod 20 = 0 then ScriptCall('onGameTick20');
 if GameTicks = NewTurnTick then
@@ -463,7 +465,7 @@
         inc(hiTicks) // we do not recieve a message for this
     end;
 AddRandomness(CheckSum);
-
+TurnClockActive:= prevtime <> TurnTimeLeft;
 inc(GameTicks)
 end;
 
diff -r 1954f692e8c6 -r 8663d299ba62 hedgewars/uGearsHedgehog.pas
--- a/hedgewars/uGearsHedgehog.pas	Sun Nov 03 22:39:00 2013 +0400
+++ b/hedgewars/uGearsHedgehog.pas	Sun Nov 03 14:45:07 2013 -0500
@@ -1266,7 +1266,7 @@
     if (Gear^.Message and (gmAllStoppable or gmLJump or gmHJump) = 0)
     and (Gear^.State and (gstHHJumping or gstHHHJump or gstAttacking) = 0)
     and ((Gear^.Hedgehog = nil) or ((Gear^.Hedgehog^.Effects[heFrozen] = 0) or (Gear^.Hedgehog^.Effects[heFrozen] > 255)))
-    and (not Gear^.dY.isNegative) and (TurnTimeLeft > 0) and (TestCollisionYwithGear(Gear, 1) and lfIce <> 0) then
+    and (not Gear^.dY.isNegative) and TurnClockActive and (TestCollisionYwithGear(Gear, 1) and lfIce <> 0) then
         begin
         slope:= CalcSlopeBelowGear(Gear);
         if slope.QWordValue > 730144440 then // ignore mild slopes
diff -r 1954f692e8c6 -r 8663d299ba62 hedgewars/uVariables.pas
--- a/hedgewars/uVariables.pas	Sun Nov 03 22:39:00 2013 +0400
+++ b/hedgewars/uVariables.pas	Sun Nov 03 14:45:07 2013 -0500
@@ -87,6 +87,7 @@
     LeftImpactTimer : LongWord;
     RightImpactTimer: LongWord;
     TurnTimeLeft    : Longword;
+    TurnClockActive : boolean;
     TagTurnTimeLeft : Longword;
     ReadyTimeLeft   : Longword;
     cSuddenDTurns   : LongInt;
@@ -2461,6 +2462,7 @@
     LeftImpactTimer     := 0;
     RightImpactTimer    := 0;
     TurnTimeLeft        := 0;
+    TurnClockActive     := true;
     TagTurnTimeLeft     := 0;
     cSuddenDTurns       := 15;
     cDamagePercent      := 100;