--- a/hedgewars/uFloat.pas Mon Apr 21 18:43:07 2008 +0000
+++ b/hedgewars/uFloat.pas Tue Apr 22 12:40:43 2008 +0000
@@ -313,12 +313,12 @@
function DistanceI(const dx, dy: LongInt): hwFloat;
begin
-DistanceI:= Distance(int2hwFloat(dx), int2hwFloat(dy))
+DistanceI:= hwSqrt(int2hwFloat(sqr(dx) + sqr(dy)))
end;
function SignAs(const num, signum: hwFloat): hwFloat;
begin
-SignAs:= num;
+SignAs.QWordValue:= num.QWordValue;
SignAs.isNegative:= signum.isNegative
end;
--- a/hedgewars/uGears.pas Mon Apr 21 18:43:07 2008 +0000
+++ b/hedgewars/uGears.pas Tue Apr 22 12:40:43 2008 +0000
@@ -864,8 +864,9 @@
uStats.HedgehogDamaged(t, dmg)
end;
DeleteCI(t);
- t^.dX:= t^.dX + hwAbs(Gear^.dX * dmg * _0_01) + SignAs(cHHKick, Gear^.dX);
+ t^.dX:= t^.dX + Gear^.dX * dmg * _0_01 + SignAs(cHHKick, Gear^.dX);
t^.dY:= t^.dY + Gear^.dY * dmg * _0_01;
+writelntoconsole('after ('+floattostr(t^.dx)+','+floattostr(t^.dy)+')');
t^.State:= t^.State or gstMoving;
t^.Active:= true;
FollowGear:= t