exclude hogs from density check
authornemo
Sun, 06 Nov 2011 10:26:12 -0500
changeset 6299 fa5bc796261d
parent 6298 6d78d3069fa3
child 6300 db8fd3ff693c
exclude hogs from density check
hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Sat Nov 05 21:51:50 2011 -0400
+++ b/hedgewars/uGears.pas	Sun Nov 06 10:26:12 2011 -0500
@@ -1314,8 +1314,17 @@
                             if ((Mask and EXPLDoNotTouchAny) = 0) and (((Mask and EXPLDoNotTouchHH) = 0) or (Gear^.Kind <> gtHedgehog)) then
                                 begin
                                 DeleteCI(Gear);
-                                Gear^.dX:= Gear^.dX + SignAs(_0_005 * dmg + cHHKick, Gear^.X - fX)/Gear^.Density;
-                                Gear^.dY:= Gear^.dY + SignAs(_0_005 * dmg + cHHKick, Gear^.Y - fY)/Gear^.Density;
+                                if Gear^.Kind <> gtHedgehog then
+                                    begin
+                                    Gear^.dX:= Gear^.dX + SignAs(_0_005 * dmg + cHHKick, Gear^.X - fX)/Gear^.Density;
+                                    Gear^.dY:= Gear^.dY + SignAs(_0_005 * dmg + cHHKick, Gear^.Y - fY)/Gear^.Density;
+                                    end
+                                else
+                                    begin
+                                    Gear^.dX:= Gear^.dX + SignAs(_0_005 * dmg + cHHKick, Gear^.X - fX);
+                                    Gear^.dY:= Gear^.dY + SignAs(_0_005 * dmg + cHHKick, Gear^.Y - fY);
+                                    end;
+
                                 Gear^.State:= (Gear^.State or gstMoving) and (not gstLoser);
                                 if not Gear^.Invulnerable then
                                     Gear^.State:= (Gear^.State or gstMoving) and (not gstWinner);