Don't use same hwFloat variable at both left and right sides of assignment (inlining bug?)
authorunc0rr
Fri, 18 Jan 2013 00:41:26 +0400
changeset 8397 5b273af3ac95
parent 8396 5123eac2f9d6
child 8398 d63a0f9d2ccb
Don't use same hwFloat variable at both left and right sides of assignment (inlining bug?) Fixes issue #482
hedgewars/uGearsHandlersRope.pas
--- a/hedgewars/uGearsHandlersRope.pas	Thu Jan 17 23:17:39 2013 +0400
+++ b/hedgewars/uGearsHandlersRope.pas	Fri Jan 18 00:41:26 2013 +0400
@@ -196,10 +196,10 @@
         ly := hwRound(ny);
         if ((ly and LAND_HEIGHT_MASK) = 0) and ((lx and LAND_WIDTH_MASK) = 0) and ((Land[ly, lx] and $FF00) <> 0) then
             begin
-            ny := _1 / Distance(ropeDx, ropeDy);
+            tx := _1 / Distance(ropeDx, ropeDy);
             // old rope pos
-            nx := ropeDx * ny;
-            ny := ropeDy * ny;
+            nx := ropeDx * tx;
+            ny := ropeDy * tx;
 
             with RopePoints.ar[RopePoints.Count] do
                 begin
@@ -210,7 +210,7 @@
                 b := (nx * HHGear^.dY) > (ny * HHGear^.dX);
                 dLen := len
                 end;
-                
+
             with RopePoints.rounded[RopePoints.Count] do
                 begin
                 X := hwRound(Gear^.X);