summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-02-20 16:24:56 +0000
committersmatz <smatz@openttd.org>2008-02-20 16:24:56 +0000
commit2657090b1fc3123140ffd81f36f2d47270b3ae7c (patch)
treee876e0eb1d299341a0b17aeb780d915219f273ec /src/openttd.cpp
parent7dbb21c69ba46f4d042b06f6c375b3a0c3bbf1b9 (diff)
downloadopenttd-2657090b1fc3123140ffd81f36f2d47270b3ae7c.tar.xz
(svn r12195) -Fix [FS#1787](r12100): there can be oil rigs at map borders, do not set water class for them
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 28da4c2dd..7f8df22d4 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -2364,7 +2364,9 @@ 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() - 1 || TileY(t) == MapMaxY() - 1)) {
+ /* skip oil rigs at borders! */
+ if ((IsTileType(t, MP_WATER) || IsBuoyTile(t)) &&
+ (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);