hedgewars/uGame.pas
branchqmlfrontend
changeset 11544 b69f5f22a3ba
parent 11539 c22d292e7266
child 11605 dc8de75747f9
--- a/hedgewars/uGame.pas	Fri Jan 01 19:15:32 2016 +0300
+++ b/hedgewars/uGame.pas	Tue Feb 09 21:11:16 2016 +0300
@@ -28,7 +28,7 @@
 ////////////////////
 uses uInputHandler, uTeams, uIO, uAI, uGears, uSound, uLocale, uCaptions,
      uTypes, uVariables, uCommands, uConsts, uVisualGearsList, uUtils
-     {$IFDEF USE_TOUCH_INTERFACE}, uTouch{$ENDIF};
+     {$IFDEF USE_TOUCH_INTERFACE}, uTouch{$ENDIF}, uDebug;
 
 procedure DoGameTick(Lag: LongInt);
 var i,j : LongInt;
@@ -40,6 +40,7 @@
 if (not CurrentTeam^.ExtDriven) then
     begin
     NetGetNextCmd; // its for the case of receiving "/say" message
+    if not allOK then exit;
     isInLag:= false;
     FlushMessages(Lag)
     end;
@@ -87,7 +88,7 @@
     end;
 PlayNextVoice;
 i:= 1;
-while (GameState <> gsExit) and (i <= Lag) do
+while (GameState <> gsExit) and (i <= Lag) and allOK do
     begin
     if not CurrentTeam^.ExtDriven then
         begin
@@ -99,6 +100,8 @@
     else
         begin
         NetGetNextCmd;
+        if not allOK then exit;
+
         if isInLag then
             case GameType of
                 gmtNet: begin