hedgewars/uGearsHandlersMess.pas
changeset 14070 aa586aadd91f
parent 14060 82956b3ba2ab
child 14079 a3506c6a4cbe
--- a/hedgewars/uGearsHandlersMess.pas	Thu Nov 01 22:54:01 2018 +0100
+++ b/hedgewars/uGearsHandlersMess.pas	Fri Nov 02 01:58:27 2018 +0300
@@ -2103,9 +2103,10 @@
         tX:=Gear^.X-targ^.X;
         tY:=Gear^.Y-targ^.Y;
         // allow escaping - should maybe flag this too
-        if (GameTicks > Gear^.FlightTime+10000) or 
-            ((tX.Round+tY.Round > Gear^.Angle*6) and
-            (hwRound(hwSqr(tX) + hwSqr(tY)) > sqr(Gear^.Angle*6))) then
+        if (GameTicks > Gear^.FlightTime + 10000) or
+            (not ((abs(tX.Round) + abs(tY.Round) < Gear^.Angle * 9) and
+                  (hwRound(hwSqr(tX) + hwSqr(tY)) < sqr(Gear^.Angle * 6))))
+             then
             targ:= nil
         end;