(svn r11589) -Fix [FS#1514]: when ship depots got destroyed they always returned to water, even when it should've been canals.

This commit is contained in:
rubidium
2007-12-07 21:14:54 +00:00
parent c21f588a14
commit cbb2d39860
6 changed files with 42 additions and 11 deletions

View File

@@ -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) {