hedgewars/uGame.pas
changeset 2786 85f6425a4d74
parent 2716 b9ca1bfca24f
child 2814 71e80c6e74bb
equal deleted inserted replaced
2785:de6406cd6b25 2786:85f6425a4d74
    25 procedure DoGameTick(Lag: LongInt);
    25 procedure DoGameTick(Lag: LongInt);
    26 
    26 
    27 ////////////////////
    27 ////////////////////
    28    implementation
    28    implementation
    29 ////////////////////
    29 ////////////////////
    30 uses uMisc, uConsts, uWorld, uKeys, uTeams, uIO, uAI, uGears, uConsole;
    30 uses uMisc, uConsts, uWorld, uKeys, uTeams, uIO, uAI, uGears, uConsole, uScript;
    31 
    31 
    32 procedure DoGameTick(Lag: LongInt);
    32 procedure DoGameTick(Lag: LongInt);
    33 var i: LongInt;
    33 var i: LongInt;
    34 begin
    34 begin
    35 if isPaused then exit;
    35 if isPaused then exit;
    44 if (GameType = gmtDemo) and isSpeed then Lag:= Lag * 10;
    44 if (GameType = gmtDemo) and isSpeed then Lag:= Lag * 10;
    45 
    45 
    46 i:= 1;
    46 i:= 1;
    47 while (GameState <> gsExit) and (i <= Lag) do
    47 while (GameState <> gsExit) and (i <= Lag) do
    48     begin
    48     begin
       
    49 	ScriptCall('onGameTick');
    49     if not CurrentTeam^.ExtDriven then
    50     if not CurrentTeam^.ExtDriven then
    50        begin
    51        begin
    51        if CurrentHedgehog^.BotLevel <> 0 then ProcessBot;
    52        if CurrentHedgehog^.BotLevel <> 0 then ProcessBot;
    52        ProcessGears
    53        ProcessGears
    53        end else
    54        end else