hedgewars/uCollisions.pas
changeset 9305 8e5140875ab5
parent 9291 15f7bb217b66
child 9521 8054d9d775fd
child 9706 5178d2263521
--- a/hedgewars/uCollisions.pas	Sat Jun 29 23:58:37 2013 +0400
+++ b/hedgewars/uCollisions.pas	Sun Jun 30 21:37:29 2013 -0400
@@ -237,12 +237,14 @@
 
     for i:= 0 to Pred(Count) do
         with cinfos[i] do
-            if (Gear <> cGear) and (sqr(mx - x) + sqr(my - y) <= sqr(Radius + Gear^.Radius + 2))
-            and ((mx > x) xor (Dir > 0)) and
+            if  (Gear <> cGear) and 
+                ((mx > x) xor (Dir > 0)) and
                 (
                   ((cGear^.Kind in [gtHedgehog, gtMine, gtKnife]) and ((Gear^.State and gstNotKickable) = 0)) or
                 // only apply X kick if the barrel is knocked over
-                ((cGear^.Kind = gtExplosives) and ((cGear^.State and gsttmpflag) <> 0))) then
+                  ((cGear^.Kind = gtExplosives) and ((cGear^.State and gsttmpflag) <> 0))
+                ) and
+                (sqr(mx - x) + sqr(my - y) <= sqr(Radius + Gear^.Radius + 2)) then
                     begin
                     with cGear^ do
                         begin
@@ -300,11 +302,11 @@
 
     for i:= 0 to Pred(Count) do
         with cinfos[i] do
-            if (Gear <> cGear) and (sqr(mx - x) + sqr(my - y) <= sqr(Radius + Gear^.Radius + 2))
-            and ((myr > y) xor (Dir > 0)) and
-                (
-                 (cGear^.Kind in [gtHedgehog, gtMine, gtKnife, gtExplosives]) and 
-                 ((Gear^.State and gstNotKickable) = 0)) then
+            if (Gear <> cGear) and
+               ((myr > y) xor (Dir > 0)) and
+               (Gear^.State and gstNotKickable = 0) and
+               (cGear^.Kind in [gtHedgehog, gtMine, gtKnife, gtExplosives]) and 
+               (sqr(mx - x) + sqr(my - y) <= sqr(Radius + Gear^.Radius + 2)) then
                     begin
                     with cGear^ do
                         begin