changeset 15709:db841e8e324a draft

(svn r20375) -Codechange: make sure the watertype for existing airport tiles is set to invalid
author yexo <yexo@openttd.org>
date Thu, 05 Aug 2010 12:06:53 +0000
parents 49e7443561b2
children 642a03a3d91e
files src/saveload/afterload.cpp src/station_cmd.cpp src/station_map.h
diffstat 3 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -2153,6 +2153,12 @@
 		FOR_ALL_DEPOTS(d) d->build_date = _date;
 	}
 
+	if (CheckSavegameVersion(145)) {
+		for (TileIndex t = 0; t < map_size; t++) {
+			if (IsAirportTile(t)) SetWaterClass(t, WATER_CLASS_INVALID);
+		}
+	}
+
 	/* Road stops is 'only' updating some caches */
 	AfterLoadRoadStops();
 	AfterLoadLabelMaps();
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2225,7 +2225,7 @@
 		it = as->table[layout];
 		do {
 			TileIndex cur_tile = tile + ToTileIndexDiff(it->ti);
-			MakeAirport(cur_tile, st->owner, st->index, it->gfx);
+			MakeAirport(cur_tile, st->owner, st->index, it->gfx, WATER_CLASS_INVALID);
 			SetStationTileRandomBits(cur_tile, GB(Random(), 0, 4));
 			st->airport.Add(cur_tile);
 
--- a/src/station_map.h
+++ b/src/station_map.h
@@ -640,10 +640,12 @@
  * @param o the owner of the airport
  * @param sid the station to which this tile belongs
  * @param section the StationGfx to be used for this tile
+ * @param wc the type of water on this tile
  */
-static inline void MakeAirport(TileIndex t, Owner o, StationID sid, byte section)
+static inline void MakeAirport(TileIndex t, Owner o, StationID sid, byte section, WaterClass wc)
 {
 	MakeStation(t, o, sid, STATION_AIRPORT, section);
+	SetWaterClass(t, wc);
 }
 
 /**