hedgewars/uAI.pas
branchhedgeroid
changeset 6328 d14adf1c7721
parent 6027 302408e45052
parent 6317 83b93a2d2741
child 6336 cf4c65f9cbbe
equal deleted inserted replaced
6236:1998ff75321a 6328:d14adf1c7721
   265    if Targets.Count > 0 then
   265    if Targets.Count > 0 then
   266       begin
   266       begin
   267 
   267 
   268       WalkMe:= BackMe;
   268       WalkMe:= BackMe;
   269       Walk(@WalkMe);
   269       Walk(@WalkMe);
   270       if (StartTicks > GameTicks - 1500) and not StopThinking then SDL_Delay(1000);
   270       if (StartTicks > GameTicks - 1500) and (not StopThinking) then SDL_Delay(1000);
   271 
       
   272       if BestActions.Score < -1023 then
   271       if BestActions.Score < -1023 then
   273          begin
   272          begin
   274          BestActions.Count:= 0;
   273          BestActions.Count:= 0;
   275          AddAction(BestActions, aia_Skip, 0, 250, 0, 0);
   274          AddAction(BestActions, aia_Skip, 0, 250, 0, 0);
   276          end;
   275          end;
   284             if not StopThinking then SDL_Delay(100)
   283             if not StopThinking then SDL_Delay(100)
   285             end
   284             end
   286       end;
   285       end;
   287 PGear(Me)^.State:= PGear(Me)^.State and not gstHHThinking;
   286 PGear(Me)^.State:= PGear(Me)^.State and not gstHHThinking;
   288 Think:= 0;
   287 Think:= 0;
   289 
   288 InterlockedDecrement(hasThread)
   290 InterlockedDecrement(hasThread);
       
   291 
       
   292 end;
   289 end;
   293 
   290 
   294 procedure StartThink(Me: PGear);
   291 procedure StartThink(Me: PGear);
   295 var a: TAmmoType;
   292 var a: TAmmoType;
   296 begin
   293 begin