Fix AI trying to use tardis during multishoot
authorWuzzy <Wuzzy2@mail.ru>
Wed, 23 Jan 2019 03:46:32 +0100
changeset 14690 fd22b6d474e7
parent 14689 38836d6c5c8a
child 14691 56831f466d1d
Fix AI trying to use tardis during multishoot
hedgewars/uAI.pas
--- a/hedgewars/uAI.pas	Tue Jan 22 23:42:23 2019 +0100
+++ b/hedgewars/uAI.pas	Wed Jan 23 03:46:32 2019 +0100
@@ -484,7 +484,7 @@
 
             // Hog has no idea what to do. Use tardis or skip
             if not bonuses.activity 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
+                if (((GameFlags and gfInfAttack) <> 0) or (CurrentHedgehog^.MultiShootAttacks = 0)) 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);