hedgewars/uGame.pas
changeset 11610 dc8de75747f9
parent 11544 c22d292e7266
child 13044 aed4b25ff242
--- a/hedgewars/uGame.pas	Mon Mar 14 14:38:23 2016 +0100
+++ b/hedgewars/uGame.pas	Mon Mar 14 22:04:39 2016 +0300
@@ -31,6 +31,7 @@
      {$IFDEF USE_TOUCH_INTERFACE}, uTouch{$ENDIF}, uDebug;
 
 procedure DoGameTick(Lag: LongInt);
+const maxCheckedGameDuration = 3*60*60*1000;
 var i,j : LongInt;
     s: ansistring;
 begin
@@ -63,7 +64,15 @@
             else Lag:= Lag*80;
             end
         else if cOnlyStats then
-            Lag:= High(LongInt)
+            begin
+                if GameTicks >= maxCheckedGameDuration then
+                begin
+                    gameState:= gsExit;
+                    exit;
+                end;
+
+            Lag:= maxCheckedGameDuration + 60000;
+            end;
     end;
 
 if cTestLua then