hedgewars/uAI.pas
changeset 146 458f4f58c1b6
parent 144 e6084b0c9316
child 183 57c2ef19f719
--- a/hedgewars/uAI.pas	Thu Sep 14 17:20:50 2006 +0000
+++ b/hedgewars/uAI.pas	Fri Sep 15 13:47:01 2006 +0000
@@ -79,6 +79,7 @@
               begin
               BestActions:= Actions;
               inc(BestActions.Score, Score);
+              
               AddAction(BestActions, aia_Weapon, Longword(a), 500);
               if Time <> 0 then AddAction(BestActions, aia_Timer, Time div 1000, 400);
               if (Angle > 0) then AddAction(BestActions, aia_LookRight, 0, 200)
@@ -250,7 +251,11 @@
       begin
       Walk(@WalkMe);
       if (StartTicks > GameTicks - 1500) and not StopThinking then SDL_Delay(2000);
-      if BestActions.Score = BadTurn then AddAction(BestActions, aia_Skip, 0, 250);
+      if BestActions.Score < -1023 then
+         begin
+         BestActions.Count:= 0;
+         AddAction(BestActions, aia_Skip, 0, 250);
+         end;
       end else
 else begin
       Walk(@WalkMe);
@@ -262,7 +267,6 @@
             Walk(@WalkMe)
             end
       end;
-
 Me.State:= Me.State and not gstHHThinking
 end;