diff options
author | frosch <frosch@openttd.org> | 2008-07-26 16:14:10 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-07-26 16:14:10 +0000 |
commit | 16c80d031c49988143fec34af598685bb8bcefd1 (patch) | |
tree | 3a62ec9adb234e8726387b1573747436f7d43e9f /src/openttd.cpp | |
parent | ea7ed286a63fdade4f1b55738a9d0fb110c00c01 (diff) | |
download | openttd-16c80d031c49988143fec34af598685bb8bcefd1.tar.xz |
(svn r13838) -Codechange: Make industry tiles aware of WaterClasses.
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(); |