Prevent AI from getting stuck in attempt to look in another direction after choosing bee weapon
authorunC0Rr
Thu, 10 Sep 2020 09:30:41 +0200
changeset 15761 94f4d0a96143
parent 15760 027a56b3895e
child 15762 0a172cfe8840
Prevent AI from getting stuck in attempt to look in another direction after choosing bee weapon
hedgewars/uAI.pas
--- a/hedgewars/uAI.pas	Sun Sep 06 00:21:37 2020 +0300
+++ b/hedgewars/uAI.pas	Thu Sep 10 09:30:41 2020 +0200
@@ -199,13 +199,13 @@
                             end;
                         end;
 
-                    AddAction(BestActions, aia_Weapon, Longword(a), 300 + random(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);
 
+                    AddAction(BestActions, aia_Weapon, Longword(a), 300 + random(400), 0, 0);
+
                     if (Ammoz[a].Ammo.Propz and ammoprop_Timerable) <> 0 then
                         AddAction(BestActions, aia_Timer, ap.Time div 1000, 400, 0, 0);