fix fort mode's edge adjustments getting lost with weWrap. issue #181
authorsheepluva
Sun, 23 Apr 2017 14:38:33 +0200
changeset 12311 1b5a4807f8f4
parent 12310 a2049a645e29
child 12312 83131d0e747b
fix fort mode's edge adjustments getting lost with weWrap. issue #181
hedgewars/uLandUtils.pas
--- a/hedgewars/uLandUtils.pas	Sun Apr 23 04:47:13 2017 +0200
+++ b/hedgewars/uLandUtils.pas	Sun Apr 23 14:38:33 2017 +0200
@@ -42,6 +42,7 @@
 
 lx:= LongInt(LAND_WIDTH) - 1;
 
+// use maximum available map width if there is no special world edge
 if WorldEdge = weNone then
     begin
     playWidth:= LAND_WIDTH;
@@ -50,6 +51,13 @@
     EXIT;
     end;
 
+// keep fort distance consistent if we're in wrap mode on fort map
+if (cMapGen = mgForts) and (WorldEdge = weWrap) then
+    begin
+    // edges were adjusted already in MakeFortsMap() in uLand
+    EXIT;
+    end;
+
 ly:= LongInt(LAND_HEIGHT) - 1;
 
 // find most left land pixels and set leftX accordingly