hedgewars/uWorld.pas
changeset 14286 e754b516cc35
parent 14230 9c5ada6431eb
child 14287 6015b74eea55
--- a/hedgewars/uWorld.pas	Thu Nov 22 22:18:21 2018 +0100
+++ b/hedgewars/uWorld.pas	Fri Nov 23 21:22:26 2018 +0100
@@ -1831,9 +1831,9 @@
 
             if (WorldEdge = weWrap) then
                 begin
-                    if dstX - prevPoint.X < (LongInt(leftX) - rightX) div 2 then
+                    if dstX - prevPoint.X < (LongInt(leftX) - LongInt(rightX)) div 2 then
                         CursorPoint.X:= (prevPoint.X * 7 + dstX - (leftX - rightX)) div 8
-                    else if dstX - prevPoint.X > (LongInt(rightX) - leftX) div 2 then
+                    else if dstX - prevPoint.X > (LongInt(rightX) - LongInt(leftX)) div 2 then
                         CursorPoint.X:= (prevPoint.X * 7 + dstX - (rightX - leftX)) div 8
                     else
                         CursorPoint.X:= (prevPoint.X * 7 + dstX) div 8;
@@ -1851,9 +1851,9 @@
 
 if (WorldEdge = weWrap) then
     begin
-        if -WorldDx < leftX then
+        if -WorldDx < LongInt(leftX) then
             WorldDx:= WorldDx - LongInt(rightX) + leftX
-        else if -WorldDx > rightX then
+        else if -WorldDx > LongInt(rightX) then
             WorldDx:= WorldDx + LongInt(rightX) - leftX;
     end;