changeset 16024:6b3718ff071d draft

(svn r20717) -Fix [FS#4103]: water class was not set for stations
author yexo <yexo@openttd.org>
date Wed, 01 Sep 2010 23:41:56 +0000
parents fea7f4fcc24d
children 56690df6f454
files src/saveload/afterload.cpp src/station_map.h
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -2288,6 +2288,15 @@
 		}
 	}
 
+	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();
--- a/src/station_map.h
+++ b/src/station_map.h
@@ -533,6 +533,7 @@
 {
 	SetTileType(t, MP_STATION);
 	SetTileOwner(t, o);
+	SetWaterClass(t, wc);
 	_m[t].m2 = sid;
 	_m[t].m3 = 0;
 	_m[t].m4 = 0;