Don't consider moving hedgehogs in place rating in after attack mode
authorunc0rr
Fri, 13 Jul 2012 01:07:53 +0400
changeset 7385 4acb5c021cb9
parent 7382 b158940f83e2
child 7388 92535bc7e928
Don't consider moving hedgehogs in place rating in after attack mode
hedgewars/uAIMisc.pas
--- a/hedgewars/uAIMisc.pas	Thu Jul 12 23:31:06 2012 +0400
+++ b/hedgewars/uAIMisc.pas	Fri Jul 13 01:07:53 2012 +0400
@@ -197,7 +197,9 @@
                 if Gear^.Damage >= Gear^.Health then
                     AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 60, -25)
                 else
-                    if isAfterAttack and (ThinkingHH^.Hedgehog <> Gear^.Hedgehog) then
+                    if isAfterAttack
+                      and (ThinkingHH^.Hedgehog <> Gear^.Hedgehog)
+                      and ((hwAbs(Gear^.dX) + hwAbs(Gear^.dY)) < _0_1) then
                         if (ClansCount > 2) or (MyClan = Gear^.Hedgehog^.Team^.Clan) then
                             AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 150, -3) // hedgehog-friend
                         else