diff options
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r-- | src/openttd.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp index 31bfeb33d..29c230c8e 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -2340,8 +2340,8 @@ bool AfterLoadGame() for (TileIndex t = 0; t < map_size; t++) { if (GetTileSlope(t, NULL) != SLOPE_FLAT) continue; - if (IsTileType(t, MP_WATER) && IsLock(t)) SetWaterClassDependingOnSurroundings(t); - if (IsTileType(t, MP_STATION) && (IsDock(t) || IsBuoy(t))) SetWaterClassDependingOnSurroundings(t); + if (IsTileType(t, MP_WATER) && IsLock(t)) SetWaterClassDependingOnSurroundings(t, false); + if (IsTileType(t, MP_STATION) && (IsDock(t) || IsBuoy(t))) SetWaterClassDependingOnSurroundings(t, false); } } @@ -2438,6 +2438,22 @@ bool AfterLoadGame() } } + if (CheckSavegameVersion(99)) { + /* Set newly introduced WaterClass of industry tiles */ + for (TileIndex t = 0; t < map_size; t++) { + if (IsTileType(t, MP_STATION) && IsOilRig(t)) { + SetWaterClassDependingOnSurroundings(t, true); + } + if (IsTileType(t, MP_INDUSTRY)) { + if ((GetIndustrySpec(GetIndustryType(t))->behaviour & INDUSTRYBEH_BUILT_ONWATER) != 0) { + SetWaterClassDependingOnSurroundings(t, true); + } else { + SetWaterClass(t, WATER_CLASS_INVALID); + } + } + } + } + GamelogPrintDebug(1); return InitializeWindowsAndCaches(); |