summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2019-04-26 19:09:55 +0100
committerPeterN <peter@fuzzle.org>2019-04-29 17:46:28 +0100
commit9da1c5bb0bdb9e09fb0bd5ed69ffa1db85ab5c09 (patch)
tree51158b6561fed24779ac544f7ed78278c3bbbdb1
parent47d0d86a3c31c3b9ae71e5bed5007d0ba0a1337d (diff)
downloadopenttd-9da1c5bb0bdb9e09fb0bd5ed69ffa1db85ab5c09.tar.xz
Fix: Crash when attempting to load old save game with GRFs set
GroupStatistics pool was not initialised before trying to delete vehicles (specifically, trams with no tram track)
-rw-r--r--src/saveload/afterload.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index 9bdfa6b34..eea896dd7 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -1900,6 +1900,7 @@ bool AfterLoadGame()
}
if (IsSavegameVersionBefore(SLV_62)) {
+ GroupStatistics::UpdateAfterLoad(); // Ensure statistics pool is initialised before trying to delete vehicles
/* Remove all trams from savegames without tram support.
* There would be trams without tram track under causing crashes sooner or later. */
RoadVehicle *v;