summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-02-10 14:16:25 +0000
committersmatz <smatz@openttd.org>2008-02-10 14:16:25 +0000
commit0fc67548324906e52ca3d97204dfba73ae9a4cb7 (patch)
treefcc2fcf995f01274332f35fc96aa82d34d066df4 /src
parentb18f96d222364fe053a749c21a17f7d14dff4b36 (diff)
downloadopenttd-0fc67548324906e52ca3d97204dfba73ae9a4cb7.tar.xz
(svn r12101) -Fix (r12100): there are void tiles at MapMaxX,Y - have to substract one to be on water border tiles
Diffstat (limited to 'src')
-rw-r--r--src/openttd.cpp2
-rw-r--r--src/water_cmd.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 98a24d613..3e86992b0 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -2364,7 +2364,7 @@ bool AfterLoadGame()
if (CheckSavegameVersion(87)) {
for (TileIndex t = 0; t < map_size; t++) {
- if (!IsTileType(t, MP_VOID) && (TileX(t) == 0 || TileY(t) == 0 || TileX(t) == MapMaxX() || TileY(t) == MapMaxY())) {
+ if (!IsTileType(t, MP_VOID) && (TileX(t) == 0 || TileY(t) == 0 || TileX(t) == MapMaxX() - 1 || TileY(t) == MapMaxY() - 1)) {
/* Some version 86 savegames have wrong water class at map borders (under buoy, or after removing buoy).
* This conversion has to be done before buoys with invalid owner are removed. */
SetWaterClass(t, WATER_CLASS_SEA);
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index 35864cf83..56da843b3 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -111,7 +111,7 @@ 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()) {
+ if (TileX(t) == 0 || TileY(t) == 0 || TileX(t) == MapMaxX() - 1 || TileY(t) == MapMaxY() - 1) {
/* tiles at map borders are always WATER_CLASS_SEA */
SetWaterClass(t, WATER_CLASS_SEA);
return;