summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-08-05 12:06:53 +0000
committeryexo <yexo@openttd.org>2010-08-05 12:06:53 +0000
commitf8b7163b34e098082b6222768966620753c4ccae (patch)
tree9884422e6f80ad56a09a3059f8d333f6ee6d4c49 /src
parent2e6713ce956d42f55f0f6f34fe12ec8459dc0ab4 (diff)
downloadopenttd-f8b7163b34e098082b6222768966620753c4ccae.tar.xz
(svn r20375) -Codechange: make sure the watertype for existing airport tiles is set to invalid
Diffstat (limited to 'src')
-rw-r--r--src/saveload/afterload.cpp6
-rw-r--r--src/station_cmd.cpp2
-rw-r--r--src/station_map.h4
3 files changed, 10 insertions, 2 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index 219ae153a..2bd49e1b8 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -2153,6 +2153,12 @@ bool AfterLoadGame()
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();
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 326567909..8e7136543 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2225,7 +2225,7 @@ CommandCost CmdBuildAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
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);
diff --git a/src/station_map.h b/src/station_map.h
index ef4e243e1..4fc85d94b 100644
--- a/src/station_map.h
+++ b/src/station_map.h
@@ -640,10 +640,12 @@ static inline void MakeDriveThroughRoadStop(TileIndex t, Owner station, Owner ro
* @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);
}
/**