From 7b0fd807fb50df320debdd8ce5661cae625b04d9 Mon Sep 17 00:00:00 2001 From: yexo Date: Wed, 1 Sep 2010 23:41:56 +0000 Subject: (svn r20717) -Fix [FS#4103]: water class was not set for stations --- src/saveload/afterload.cpp | 9 +++++++++ src/station_map.h | 1 + 2 files changed, 10 insertions(+) (limited to 'src') diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index f636c0cc8..61183f30c 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -2288,6 +2288,15 @@ bool AfterLoadGame() } } + if (CheckSavegameVersion(149)) { + for (TileIndex t = 0; t < map_size; t++) { + if (!IsTileType(t, MP_STATION)) continue; + if (!IsBuoy(t) && !IsOilRig(t) && !(IsDock(t) && GetTileSlope(t, NULL) == SLOPE_FLAT)) { + SetWaterClass(t, WATER_CLASS_INVALID); + } + } + } + /* Road stops is 'only' updating some caches */ AfterLoadRoadStops(); AfterLoadLabelMaps(); diff --git a/src/station_map.h b/src/station_map.h index c8204c40e..8d3bcb54d 100644 --- a/src/station_map.h +++ b/src/station_map.h @@ -533,6 +533,7 @@ static inline void MakeStation(TileIndex t, Owner o, StationID sid, StationType { SetTileType(t, MP_STATION); SetTileOwner(t, o); + SetWaterClass(t, wc); _m[t].m2 = sid; _m[t].m3 = 0; _m[t].m4 = 0; -- cgit v1.2.3-54-g00ecf