AI: Don't use tardis when in multishoot and not inf attack
authorWuzzy <Wuzzy2@mail.ru>
Thu, 08 Mar 2018 23:36:16 +0100
changeset 13138 733f3154198c
parent 13136 f10f4bf5f84d
child 13139 d204ed947785
AI: Don't use tardis when in multishoot and not inf attack
hedgewars/uAI.pas
--- a/hedgewars/uAI.pas	Thu Mar 08 21:58:59 2018 +0100
+++ b/hedgewars/uAI.pas	Thu Mar 08 23:36:16 2018 +0100
@@ -474,7 +474,7 @@
 
             // Hog has no idea what to do. Use tardis or skip
             if not bonuses.activity then
-                if ((HHHasAmmo(Me^.Hedgehog^, amTardis) > 0)) and (CanUseTardis(Me^.Hedgehog^.Gear)) and (random(4) < 3) then
+                if (((GameFlags and gfInfAttack) <> 0) or (not isInMultiShoot)) and ((HHHasAmmo(Me^.Hedgehog^, amTardis) > 0)) and (CanUseTardis(Me^.Hedgehog^.Gear)) and (random(4) < 3) then
                     // Tardis brings hog to a random place. Perfect for clueless AI
                     begin
                     AddAction(BestActions, aia_Weapon, Longword(amTardis), 80, 0, 0);