hedgewars/uGearsUtils.pas
changeset 14287 6015b74eea55
parent 14208 076c9fba3fa8
child 14297 1d4f1d700cdc
--- a/hedgewars/uGearsUtils.pas	Fri Nov 23 21:22:26 2018 +0100
+++ b/hedgewars/uGearsUtils.pas	Fri Nov 23 15:54:23 2018 -0500
@@ -238,12 +238,12 @@
         break;
 
     // Radius + 5 because that's the actual radius the explosion changes graphically
-    if X + (Radius + 5) > LongInt(rightX) then
+    if X + (Radius + 5) > rightX then
         begin
         dec(X, playWidth);
         wrap:= true;
         end
-    else if X - (Radius + 5) < LongInt(leftX) then
+    else if X - (Radius + 5) < leftX then
         begin
         inc(X, playWidth);
         wrap:= true;
@@ -664,7 +664,7 @@
     if WorldEdge = weSea then
         begin
         tmp:= dist2Water;
-        dist2Water:= min(dist2Water, min(X - Gear^.Radius - LongInt(leftX), LongInt(rightX) - (X + Gear^.Radius)));
+        dist2Water:= min(dist2Water, min(X - Gear^.Radius - leftX, rightX - (X + Gear^.Radius)));
         // if water on sides is closer than on bottom -> horizontal direction
         isDirH:= tmp <> dist2Water;
         end;
@@ -935,7 +935,7 @@
 tryAgain:= true;
 if WorldEdge <> weNone then
     begin
-    Left:= max(Left, LongInt(leftX) + Gear^.Radius);
+    Left:= max(Left, leftX + Gear^.Radius);
     Right:= min(Right,rightX-Gear^.Radius)
     end;
 while tryAgain do
@@ -1748,12 +1748,12 @@
 begin
 WorldWrap:= false;
 if WorldEdge = weNone then exit(false);
-if (hwRound(Gear^.X) < LongInt(leftX)) or
-   (hwRound(Gear^.X) > LongInt(rightX)) then
+if (hwRound(Gear^.X) < leftX) or
+   (hwRound(Gear^.X) > rightX) then
     begin
     if WorldEdge = weWrap then
         begin
-        if (hwRound(Gear^.X) < LongInt(leftX)) then
+        if (hwRound(Gear^.X) < leftX) then
              Gear^.X:= Gear^.X + int2hwfloat(rightX - leftX)
         else Gear^.X:= Gear^.X - int2hwfloat(rightX - leftX);
         LeftImpactTimer:= 150;
@@ -1761,11 +1761,11 @@
         end
     else if WorldEdge = weBounce then
         begin
-        if (hwRound(Gear^.X) - Gear^.Radius < LongInt(leftX)) then
+        if (hwRound(Gear^.X) - Gear^.Radius < leftX) then
             begin
             LeftImpactTimer:= 333;
             Gear^.dX.isNegative:= false;
-            Gear^.X:= int2hwfloat(LongInt(leftX) + Gear^.Radius)
+            Gear^.X:= int2hwfloat(leftX + Gear^.Radius)
             end
         else
             begin