--- a/hedgewars/GSHandlers.inc Mon Jun 28 21:52:00 2010 +0200
+++ b/hedgewars/GSHandlers.inc Tue Jun 29 05:22:25 2010 +0200
@@ -1238,14 +1238,15 @@
HHGear^.dY := SignAs(hwAbs(HHGear^.dY) + _0_2, HHGear^.dY)
end;
- len := Distance(HHGear^.dX, HHGear^.dY);
- if len > _0_8 then
+ len := hwSqr(HHGear^.dX) + hwSqr(HHGear^.dY);
+ if len > _0_64 then
begin
- len := _0_8 / len;
+ len := _0_8 / hwSqrt(len);
HHGear^.dX := HHGear^.dX * len;
HHGear^.dY := HHGear^.dY * len;
end;
+
if (Gear^.Message and gm_Attack) <> 0 then
if (Gear^.State and gsttmpFlag) <> 0 then
with PHedgehog(Gear^.Hedgehog)^ do