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)
(cherry picked from commit 9da1c5bb0b
)
This commit is contained in:

committed by
Jonathan G Rennison

parent
9197926bca
commit
44911ec254
@@ -2095,6 +2095,7 @@ bool AfterLoadGame()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (IsSavegameVersionBefore(SLV_62)) {
|
if (IsSavegameVersionBefore(SLV_62)) {
|
||||||
|
GroupStatistics::UpdateAfterLoad(); // Ensure statistics pool is initialised before trying to delete vehicles
|
||||||
/* Remove all trams from savegames without tram support.
|
/* Remove all trams from savegames without tram support.
|
||||||
* There would be trams without tram track under causing crashes sooner or later. */
|
* There would be trams without tram track under causing crashes sooner or later. */
|
||||||
RoadVehicle *v;
|
RoadVehicle *v;
|
||||||
|
Reference in New Issue
Block a user