hedgewars/uGame.pas
changeset 11610 dc8de75747f9
parent 11544 c22d292e7266
child 13044 aed4b25ff242
equal deleted inserted replaced
11609:4df32636a4b2 11610:dc8de75747f9
    29 uses uInputHandler, uTeams, uIO, uAI, uGears, uSound, uLocale, uCaptions,
    29 uses uInputHandler, uTeams, uIO, uAI, uGears, uSound, uLocale, uCaptions,
    30      uTypes, uVariables, uCommands, uConsts, uVisualGearsList, uUtils
    30      uTypes, uVariables, uCommands, uConsts, uVisualGearsList, uUtils
    31      {$IFDEF USE_TOUCH_INTERFACE}, uTouch{$ENDIF}, uDebug;
    31      {$IFDEF USE_TOUCH_INTERFACE}, uTouch{$ENDIF}, uDebug;
    32 
    32 
    33 procedure DoGameTick(Lag: LongInt);
    33 procedure DoGameTick(Lag: LongInt);
       
    34 const maxCheckedGameDuration = 3*60*60*1000;
    34 var i,j : LongInt;
    35 var i,j : LongInt;
    35     s: ansistring;
    36     s: ansistring;
    36 begin
    37 begin
    37 if isPaused then
    38 if isPaused then
    38     exit;
    39     exit;
    61             else if i < 6000 then Lag:= Lag*20
    62             else if i < 6000 then Lag:= Lag*20
    62             else if i < 8000 then Lag:= Lag*40
    63             else if i < 8000 then Lag:= Lag*40
    63             else Lag:= Lag*80;
    64             else Lag:= Lag*80;
    64             end
    65             end
    65         else if cOnlyStats then
    66         else if cOnlyStats then
    66             Lag:= High(LongInt)
    67             begin
       
    68                 if GameTicks >= maxCheckedGameDuration then
       
    69                 begin
       
    70                     gameState:= gsExit;
       
    71                     exit;
       
    72                 end;
       
    73 
       
    74             Lag:= maxCheckedGameDuration + 60000;
       
    75             end;
    67     end;
    76     end;
    68 
    77 
    69 if cTestLua then
    78 if cTestLua then
    70     Lag:= High(LongInt);
    79     Lag:= High(LongInt);
    71 
    80