hedgewars/uAI.pas
changeset 14506 a4d560aeda96
parent 14226 545b85c0f2e3
child 14507 184df3900ec4
equal deleted inserted replaced
14505:ba29aa03db87 14506:a4d560aeda96
   542     begin
   542     begin
   543     OutError('AI: no targets!?', false);
   543     OutError('AI: no targets!?', false);
   544     exit
   544     exit
   545     end;
   545     end;
   546 
   546 
   547 FillBonuses(((Me^.State and gstAttacked) <> 0) and (not isInMultiShoot));
   547 FillBonuses(((Me^.State and gstAttacked) <> 0) and (not isInMultiShoot) and ((GameFlags and gfInfAttack) = 0));
   548 
   548 
   549 SDL_LockMutex(ThreadLock);
   549 SDL_LockMutex(ThreadLock);
   550 ThinkThread:= SDL_CreateThread(@Think, PChar('think'), Me);
   550 ThinkThread:= SDL_CreateThread(@Think, PChar('think'), Me);
   551 SDL_UnlockMutex(ThreadLock);
   551 SDL_UnlockMutex(ThreadLock);
   552 end;
   552 end;
   559 const cStopThinkTime = 40;
   559 const cStopThinkTime = 40;
   560 begin
   560 begin
   561 with CurrentHedgehog^ do
   561 with CurrentHedgehog^ do
   562     if (Gear <> nil)
   562     if (Gear <> nil)
   563     and ((Gear^.State and gstHHDriven) <> 0)
   563     and ((Gear^.State and gstHHDriven) <> 0)
   564     and (TurnTimeLeft < cHedgehogTurnTime - 50) then
   564     and ((TurnTimeLeft < cHedgehogTurnTime - 50) or (TurnTimeLeft > cHedgehogTurnTime)) then
   565         if ((Gear^.State and gstHHThinking) = 0) then
   565         if ((Gear^.State and gstHHThinking) = 0) then
   566             if (BestActions.Pos >= BestActions.Count)
   566             if (BestActions.Pos >= BestActions.Count)
   567             and (TurnTimeLeft > cStopThinkTime) then
   567             and (TurnTimeLeft > cStopThinkTime) then
   568                 begin
   568                 begin
   569                 if Gear^.Message <> 0 then
   569                 if Gear^.Message <> 0 then