Include density in gear kick
authornemo
Sat, 05 Nov 2011 21:24:54 -0400
changeset 6297 f2942ea53e53
parent 6296 0cd63375e80b
child 6298 6d78d3069fa3
Include density in gear kick
hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Sat Nov 05 21:01:21 2011 -0400
+++ b/hedgewars/uGears.pas	Sat Nov 05 21:24:54 2011 -0400
@@ -1314,8 +1314,8 @@
                             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^.dY:= Gear^.dY + SignAs(_0_005 * dmg + cHHKick, Gear^.Y - fY);
+                                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;
                                 Gear^.State:= (Gear^.State or gstMoving) and (not gstLoser);
                                 if not Gear^.Invulnerable then
                                     Gear^.State:= (Gear^.State or gstMoving) and (not gstWinner);