rename length to something different
authoralfadur
Fri, 31 May 2019 21:34:32 +0300
changeset 15110 24994035a0e0
parent 15109 9aa1ab824ec7
child 15111 33eca3f0a9aa
rename length to something different
hedgewars/uGearsRender.pas
--- a/hedgewars/uGearsRender.pas	Fri May 31 19:02:42 2019 +0200
+++ b/hedgewars/uGearsRender.pas	Fri May 31 21:34:32 2019 +0300
@@ -96,7 +96,7 @@
 
 
 procedure DrawRopeLine(X1, Y1, X2, Y2: Real; LayerIndex: Longword; var linesLength, ropeLength: Real);
-var dX, dY, angle, length: Real;
+var dX, dY, angle, lineLength: Real;
     FrameIndex: LongWord;
 begin
     if (X1 = X2) and (Y1 = Y2) then
@@ -104,13 +104,13 @@
 
     dX:= X2 - X1;
     dY:= Y2 - Y1;
-    length:= sqrt(sqr(dX) + sqr(dY));
+    lineLength:= sqrt(sqr(dX) + sqr(dY));
     angle:= arctan2(dY, dX) * 180 / PI - 90;
 
-    dX:= dX / length;
-    dY:= dY / length;
+    dX:= dX / lineLength;
+    dY:= dY / lineLength;
 
-    while (ropeLength - linesLength) <= length do
+    while (ropeLength - linesLength) <= lineLength do
     begin
         FrameIndex:= round(ropeLength / cRopeNodeStep);
         if (FrameIndex mod cRopeLayers) = LayerIndex then
@@ -120,7 +120,7 @@
                 FrameIndex, 1, angle);
         ropeLength:= ropeLength + cRopeNodeStep;
     end;
-    linesLength:= linesLength + length
+    linesLength:= linesLength + lineLength
 end;
 
 procedure DrawRopeLayer(Gear: PGear; LayerIndex: LongWord);