summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 0d2b146ce..9c930d694 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -115,9 +115,11 @@ TileIndex TileAddWrap(TileIndex tile, int addx, int addy)
uint x = TileX(tile) + addx;
uint y = TileY(tile) + addy;
+ /* Disallow void tiles at the north border. */
+ if (_settings_game.construction.freeform_edges && (x == 0 || y == 0)) return INVALID_TILE;
+
/* Are we about to wrap? */
- if (x < MapMaxX() && y < MapMaxY())
- return tile + TileDiffXY(addx, addy);
+ if (x < MapMaxX() && y < MapMaxY()) return tile + TileDiffXY(addx, addy);
return INVALID_TILE;
}