summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-03-10 18:46:26 +0000
committeryexo <yexo@openttd.org>2010-03-10 18:46:26 +0000
commit0cf90dbeb09cdcbd2b949371c76ab488f19082e9 (patch)
tree1c8f05452b54121c6e5e723e0dd2adf1263dadcc /src
parent5a9ffbb1b8bf28a44baebd0dc0d6dbe7684015b0 (diff)
downloadopenttd-0cf90dbeb09cdcbd2b949371c76ab488f19082e9.tar.xz
(svn r19380) -Fix [FS#3678] (r19322): updating the id of the oilrig airport should be done earlier as it can be used by newgrf code
Diffstat (limited to 'src')
-rw-r--r--src/saveload/afterload.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index d2b886c6d..70af6d474 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -586,6 +586,18 @@ bool AfterLoadGame()
* filled; and that could eventually lead to desyncs. */
CargoPacket::AfterLoad();
+ /* Oilrig was moved from id 15 to 9. We have to do this conversion
+ * here as AfterLoadVehicles can check it indirectly via the newgrf
+ * code. */
+ if (CheckSavegameVersion(139)) {
+ Station *st;
+ FOR_ALL_STATIONS(st) {
+ if (st->airport.tile != INVALID_TILE && st->airport_type == 15) {
+ st->airport_type = AT_OILRIG;
+ }
+ }
+ }
+
/* Update all vehicles */
AfterLoadVehicles(true);
@@ -2067,7 +2079,6 @@ bool AfterLoadGame()
Station *st;
FOR_ALL_STATIONS(st) {
if (st->airport.tile != INVALID_TILE) {
- if (st->airport_type == 15) st->airport_type = AT_OILRIG;
st->airport.w = st->GetAirportSpec()->size_x;
st->airport.h = st->GetAirportSpec()->size_y;
}