hedgewars/uGame.pas
changeset 2621 956ff066f3a5
parent 2599 c7153d2348f3
child 2630 079ef82eac75
equal deleted inserted replaced
2620:796269129c47 2621:956ff066f3a5
    21 uses uFloat;
    21 uses uFloat;
    22 {$INCLUDE "options.inc"}
    22 {$INCLUDE "options.inc"}
    23 
    23 
    24 procedure DoGameTick(Lag: LongInt);
    24 procedure DoGameTick(Lag: LongInt);
    25 
    25 
    26 var skipFlag: boolean = false;
       
    27 
       
    28 ////////////////////
    26 ////////////////////
    29    implementation
    27    implementation
    30 ////////////////////
    28 ////////////////////
    31 uses uMisc, uConsts, uWorld, uKeys, uTeams, uIO, uAI, uGears, uConsole;
    29 uses uMisc, uConsts, uWorld, uKeys, uTeams, uIO, uAI, uGears, uConsole;
    32 
    30 
    45 if (GameType = gmtDemo) and isSpeed then Lag:= Lag * 10;
    43 if (GameType = gmtDemo) and isSpeed then Lag:= Lag * 10;
    46 
    44 
    47 i:= 1;
    45 i:= 1;
    48 while (GameState <> gsExit) and (i <= Lag) do
    46 while (GameState <> gsExit) and (i <= Lag) do
    49     begin
    47     begin
    50     skipFlag:= false;
       
    51     if not CurrentTeam^.ExtDriven then
    48     if not CurrentTeam^.ExtDriven then
    52        begin
    49        begin
    53        if CurrentHedgehog^.BotLevel <> 0 then ProcessBot;
    50        if CurrentHedgehog^.BotLevel <> 0 then ProcessBot;
    54        ProcessGears
    51        ProcessGears
    55        end else
    52        end else
    72                         GameType:= gmtLocal
    69                         GameType:= gmtLocal
    73                         end;
    70                         end;
    74                end
    71                end
    75           else ProcessGears
    72           else ProcessGears
    76        end;
    73        end;
    77     if skipFlag then TurnTimeLeft:= 0;
       
    78     inc(i)
    74     inc(i)
    79     end
    75     end
    80 end;
    76 end;
    81 
    77 
    82 end.
    78 end.