hedgewars/uAI.pas
changeset 445 fb66abeb551f
parent 442 57ed1444606e
child 498 9c8b385dc9a1
equal deleted inserted replaced
444:e3aaa862a28e 445:fb66abeb551f
    23 procedure ProcessBot;
    23 procedure ProcessBot;
    24 procedure FreeActionsList;
    24 procedure FreeActionsList;
    25 
    25 
    26 implementation
    26 implementation
    27 uses uTeams, uConsts, SDLh, uAIMisc, uGears, uAIAmmoTests, uAIActions, uMisc,
    27 uses uTeams, uConsts, SDLh, uAIMisc, uGears, uAIAmmoTests, uAIActions, uMisc,
    28      uAmmos;
    28      uAmmos, uConsole;
    29 
    29 
    30 var BestActions: TActions;
    30 var BestActions: TActions;
    31     ThinkThread: PSDL_Thread = nil;
    31     ThinkThread: PSDL_Thread = nil;
    32     StopThinking: boolean;
    32     StopThinking: boolean;
    33     CanUseAmmo: array [TAmmoType] of boolean;
    33     CanUseAmmo: array [TAmmoType] of boolean;
    42    SDL_WaitThread(ThinkThread, nil);
    42    SDL_WaitThread(ThinkThread, nil);
    43    ThinkThread:= nil
    43    ThinkThread:= nil
    44    end;
    44    end;
    45 
    45 
    46    with CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog] do
    46    with CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog] do
    47      if Gear <> nil then Gear^.Message:= 0;
    47      if Gear <> nil then
       
    48         if BotLevel <> 0 then
       
    49            begin
       
    50            if (Gear^.Message and gm_Left) <> 0 then ParseCommand('-left', true);
       
    51            if (Gear^.Message and gm_Right) <> 0 then ParseCommand('-right', true);
       
    52            end;
    48      
    53      
    49 BestActions.Count:= 0;
    54 BestActions.Count:= 0;
    50 BestActions.Pos:= 0
    55 BestActions.Pos:= 0
    51 end;
    56 end;
    52 
    57