summaryrefslogtreecommitdiff
path: root/ttd.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-12-30 10:29:28 +0000
committertruelight <truelight@openttd.org>2004-12-30 10:29:28 +0000
commit4b38004a490127410b62edac1abcc55b34fdf1d6 (patch)
tree0f11f4c68ab4017777eeac6fcd26a9b9da7ae20c /ttd.c
parent546fcfa3ec6828dba8ebedac449a96284bfd7e06 (diff)
downloadopenttd-4b38004a490127410b62edac1abcc55b34fdf1d6.tar.xz
(svn r1302) -Fix: [ 1091655 ] In some older maps somehow water is owned by
OWNER_NONE instead of OWNER_WATER. -Fix: On InitializeLandscape the map was made MP_WATER, but OWNER_NONE. When ConvertGroundTilesIntoWaterTiles() is not called, this gives big problems (see above). Now the owner is set to OWNER_WATER by default.
Diffstat (limited to 'ttd.c')
-rw-r--r--ttd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ttd.c b/ttd.c
index dad32ce9d..8ccf1f00a 100644
--- a/ttd.c
+++ b/ttd.c
@@ -1229,6 +1229,21 @@ bool AfterLoadGame(uint version)
UpdateCurrencies();
}
+ /* In old version there seems to be a problem that water is owned by
+ OWNER_NONE, not OWNER_WATER.. I can't replicate it for the current
+ (0x402) version, so I just check when versions are older, and then
+ walk through the whole map.. */
+ if (version <= 0x402) {
+ TileIndex tile = TILE_XY(0,0);
+ uint w = MapSizeX();
+ uint h = MapSizeY();
+
+ BEGIN_TILE_LOOP(tile_cur, w, h, tile)
+ if (IS_TILETYPE(tile_cur, MP_WATER) && _map_owner[tile_cur] != OWNER_WATER)
+ _map_owner[tile_cur] = OWNER_WATER;
+ END_TILE_LOOP(tile_cur, w, h, tile)
+ }
+
// convert road side to my format.
if (_opt.road_side) _opt.road_side = 1;