Skip frame increments if FrameTicks is over 1000 seconds per frame, probably indicating static at that point.
authornemo
Thu, 04 Dec 2014 11:11:17 -0500
changeset 10623 81f1cf934827
parent 10622 9551211455a3
child 10624 05bb44f4d92f
Skip frame increments if FrameTicks is over 1000 seconds per frame, probably indicating static at that point.
hedgewars/uVisualGearsHandlers.pas
--- a/hedgewars/uVisualGearsHandlers.pas	Wed Dec 03 18:49:10 2014 +0100
+++ b/hedgewars/uVisualGearsHandlers.pas	Thu Dec 04 11:11:17 2014 -0500
@@ -86,20 +86,23 @@
 sign:= 1;
 with Gear^ do
     begin
-    inc(FrameTicks, Steps);
-    if not SuddenDeathDmg and (FrameTicks > vobFrameTicks) then
+    if FrameTicks < 1000000 then
         begin
-        dec(FrameTicks, vobFrameTicks);
-        inc(Frame);
-        if Frame = vobFramesCount then
-            Frame:= 0
-        end
-    else if SuddenDeathDmg and (FrameTicks > vobSDFrameTicks) then
-        begin
-        dec(FrameTicks, vobSDFrameTicks);
-        inc(Frame);
-        if Frame = vobSDFramesCount then
-            Frame:= 0
+        inc(FrameTicks, Steps);
+        if not SuddenDeathDmg and (FrameTicks > vobFrameTicks) then
+            begin
+            dec(FrameTicks, vobFrameTicks);
+            inc(Frame);
+            if Frame = vobFramesCount then
+                Frame:= 0
+            end
+        else if SuddenDeathDmg and (FrameTicks > vobSDFrameTicks) then
+            begin
+            dec(FrameTicks, vobSDFrameTicks);
+            inc(Frame);
+            if Frame = vobSDFramesCount then
+                Frame:= 0
+            end;
         end;
     X:= X + (cWindSpeedf * 400 + dX + tdX) * Steps * Gear^.Scale;
     if SuddenDeathDmg then