Mercurial > hg > openttd
comparison src/openttd.cpp @ 8029:d9a4375b24c0 draft
(svn r11589) -Fix [FS#1514]: when ship depots got destroyed they always returned to water, even when it should've been canals.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Fri, 07 Dec 2007 21:14:54 +0000 |
parents | f28e9c06e122 |
children | 99ade4087f55 |
comparison
equal
deleted
inserted
replaced
8028:936ad1eb1c04 | 8029:d9a4375b24c0 |
---|---|
2201 SetTileOwner(t, OWNER_NONE); | 2201 SetTileOwner(t, OWNER_NONE); |
2202 } | 2202 } |
2203 } | 2203 } |
2204 } | 2204 } |
2205 | 2205 |
2206 /* | |
2207 * Add the 'previous' owner to the ship depots so we can reset it with | |
2208 * the correct values when it gets destroyed. This prevents that | |
2209 * someone can remove canals owned by somebody else and it prevents | |
2210 * making floods using the removal of ship depots. | |
2211 */ | |
2212 if (CheckSavegameVersion(83)) { | |
2213 for (TileIndex t = 0; t < map_size; t++) { | |
2214 if (IsTileType(t, MP_WATER) && IsShipDepot(t)) { | |
2215 _m[t].m4 = (TileHeight(t) == 0) ? OWNER_WATER : OWNER_NONE; | |
2216 } | |
2217 } | |
2218 } | |
2219 | |
2206 if (CheckSavegameVersion(74)) { | 2220 if (CheckSavegameVersion(74)) { |
2207 Station *st; | 2221 Station *st; |
2208 FOR_ALL_STATIONS(st) { | 2222 FOR_ALL_STATIONS(st) { |
2209 for (CargoID c = 0; c < NUM_CARGO; c++) { | 2223 for (CargoID c = 0; c < NUM_CARGO; c++) { |
2210 st->goods[c].last_speed = 0; | 2224 st->goods[c].last_speed = 0; |