# HG changeset patch # User unc0rr # Date 1303202143 -14400 # Node ID 60bc1af75c820b54cebbf6b51b4cab8329e5fb0b # Parent 72f6eda2f73a820a3944a5a5094b28ddc2560754 Fix AI trying to turn around in targeting mode diff -r 72f6eda2f73a -r 60bc1af75c82 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);