summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-12-07 21:14:54 +0000
committerrubidium <rubidium@openttd.org>2007-12-07 21:14:54 +0000
commitc3ae7faa133cdd646ce6bf6ece6c1bf7935da014 (patch)
tree564b72840ffd1f1485b52afdcd03fc9e08aaab24 /src/openttd.cpp
parentb00f62123960a9beaf85da92df2537b24d5c0295 (diff)
downloadopenttd-c3ae7faa133cdd646ce6bf6ece6c1bf7935da014.tar.xz
(svn r11589) -Fix [FS#1514]: when ship depots got destroyed they always returned to water, even when it should've been canals.
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 6a431e629..6df56e31b 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -2203,6 +2203,20 @@ bool AfterLoadGame()
}
}
+ /*
+ * Add the 'previous' owner to the ship depots so we can reset it with
+ * the correct values when it gets destroyed. This prevents that
+ * someone can remove canals owned by somebody else and it prevents
+ * making floods using the removal of ship depots.
+ */
+ if (CheckSavegameVersion(83)) {
+ for (TileIndex t = 0; t < map_size; t++) {
+ if (IsTileType(t, MP_WATER) && IsShipDepot(t)) {
+ _m[t].m4 = (TileHeight(t) == 0) ? OWNER_WATER : OWNER_NONE;
+ }
+ }
+ }
+
if (CheckSavegameVersion(74)) {
Station *st;
FOR_ALL_STATIONS(st) {