summaryrefslogtreecommitdiff
path: root/src/water_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/water_cmd.cpp')
-rw-r--r--src/water_cmd.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index 99141d795..35864cf83 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -111,6 +111,12 @@ void SetWaterClassDependingOnSurroundings(TileIndex t)
/* Mark tile dirty in all cases */
MarkTileDirtyByTile(t);
+ if (TileX(t) == 0 || TileY(t) == 0 || TileX(t) == MapMaxX() || TileY(t) == MapMaxY()) {
+ /* tiles at map borders are always WATER_CLASS_SEA */
+ SetWaterClass(t, WATER_CLASS_SEA);
+ return;
+ }
+
bool has_water = false;
bool has_canal = false;
bool has_river = false;