summaryrefslogtreecommitdiff
path: root/src/saveload/afterload.cpp
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2021-11-15 13:39:41 +0000
committerGitHub <noreply@github.com>2021-11-15 13:39:41 +0000
commitcf16f452da6d1cc8d4777ea4021d0c29b5679835 (patch)
treec6eedf0ba75c9eb4b0d453e632ef57aee774b8ab /src/saveload/afterload.cpp
parent0cbe94256e4f600ceb397ddf8c0e3dca60676e5b (diff)
downloadopenttd-cf16f452da6d1cc8d4777ea4021d0c29b5679835.tar.xz
Fix #9680: Recalculating aircraft positions before map array updates caused crashes (#9699)
Diffstat (limited to 'src/saveload/afterload.cpp')
-rw-r--r--src/saveload/afterload.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index d3194cd4e..bc8ffd247 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -957,10 +957,6 @@ bool AfterLoadGame()
}
}
- /* In version 2.2 of the savegame, we have new airports, so status of all aircraft is reset.
- * This has to be called after the oilrig airport_type update above ^^^ ! */
- if (IsSavegameVersionBefore(SLV_2, 2)) UpdateOldAircraft();
-
/* In version 6.1 we put the town index in the map-array. To do this, we need
* to use m2 (16bit big), so we need to clean m2, and that is where this is
* all about ;) */
@@ -2899,6 +2895,10 @@ bool AfterLoadGame()
}
}
+ /* In version 2.2 of the savegame, we have new airports, so status of all aircraft is reset.
+ * This has to be called after all map array updates */
+ if (IsSavegameVersionBefore(SLV_2, 2)) UpdateOldAircraft();
+
if (IsSavegameVersionBefore(SLV_188)) {
/* Fix articulated road vehicles.
* Some curves were shorter than other curves.