Fix AI trying to turn around in targeting mode
authorunc0rr
Tue, 19 Apr 2011 12:35:43 +0400
changeset 5162 60bc1af75c82
parent 5161 72f6eda2f73a
child 5163 1620a02d5282
Fix AI trying to turn around in targeting mode
hedgewars/uAI.pas
--- a/hedgewars/uAI.pas	Mon Apr 18 23:35:44 2011 -0400
+++ b/hedgewars/uAI.pas	Tue Apr 19 12:35:43 2011 +0400
@@ -87,10 +87,11 @@
               BestActions:= Actions;
               inc(BestActions.Score, Score);
 
+              if (ap.Angle > 0) then AddAction(BestActions, aia_LookRight, 0, 200, 0, 0)
+              else if (ap.Angle < 0) then AddAction(BestActions, aia_LookLeft, 0, 200, 0, 0);
+
               AddAction(BestActions, aia_Weapon, Longword(a), 300 + random(400), 0, 0);
               if (ap.Time <> 0) then AddAction(BestActions, aia_Timer, ap.Time div 1000, 400, 0, 0);
-              if (ap.Angle > 0) then AddAction(BestActions, aia_LookRight, 0, 200, 0, 0)
-              else if (ap.Angle < 0) then AddAction(BestActions, aia_LookLeft, 0, 200, 0, 0);
               if (Ammoz[a].Ammo.Propz and ammoprop_NoCrosshair) = 0 then
                  begin
                  ap.Angle:= LongInt(Me^.Angle) - Abs(ap.Angle);