summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-02-06 15:32:06 +0000
committerfrosch <frosch@openttd.org>2008-02-06 15:32:06 +0000
commite95e8877721a35b5e9c6761f4c40a8a0396a9168 (patch)
treeb5b474ed58e225718126beb6492afa26fc617e6e /src/openttd.cpp
parent94f421798447a1362ea861308453ae2d30cab839 (diff)
downloadopenttd-e95e8877721a35b5e9c6761f4c40a8a0396a9168.tar.xz
(svn r12070) -Cleanup(r12042): Water-owner of shipdepots is no longer needed. Removed.
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 1b298de8b..85722845a 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -2333,9 +2333,16 @@ bool AfterLoadGame()
if (_m[t].m5 == 2) {
MakeRiver(t, Random());
} else {
- Owner o = GetTileOwner(t);
- if (IsWater(t) && o != OWNER_WATER) {
- MakeCanal(t, o, Random());
+ if (IsWater(t)) {
+ Owner o = GetTileOwner(t);
+ if (o == OWNER_WATER) {
+ MakeWater(t);
+ } else {
+ MakeCanal(t, o, Random());
+ }
+ } else if (IsShipDepot(t)) {
+ Owner o = (Owner)_m[t].m4; // Original water owner
+ SetWaterClass(t, o == OWNER_WATER ? WATER_CLASS_SEA : WATER_CLASS_CANAL);
}
}
}
@@ -2347,7 +2354,7 @@ bool AfterLoadGame()
for (TileIndex t = 0; t < map_size; t++) {
if (GetTileSlope(t, NULL) != SLOPE_FLAT) continue;
- if (IsTileType(t, MP_WATER) && (GetWaterTileType(t) == WATER_TILE_LOCK || IsShipDepot(t))) SetWaterClassDependingOnSurroundings(t);
+ if (IsTileType(t, MP_WATER) && IsLock(t)) SetWaterClassDependingOnSurroundings(t);
if (IsTileType(t, MP_STATION) && (IsDock(t) || IsBuoy(t))) SetWaterClassDependingOnSurroundings(t);
}
}