1
0
Fork 0

Change: Update group statistics earlier in AfterLoad

This commit prefaces the next incoming set of commit changes in order to have the vehicle lists already generated as an attempt to prevent AfterLoad actions accessing them empty.
pull/10548/head
SamuXarick 2024-01-01 17:17:10 +00:00
parent ac1e2ef077
commit 021817aa61
2 changed files with 2 additions and 2 deletions

View File

@ -1899,7 +1899,6 @@ 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. */
for (RoadVehicle *v : RoadVehicle::Iterate()) {
@ -3317,7 +3316,6 @@ void ReloadNewGRFData()
ResetVehicleHash();
AfterLoadVehicles(false);
StartupEngines();
GroupStatistics::UpdateAfterLoad();
/* update station graphics */
AfterLoadStations();
/* Update company statistics. */

View File

@ -491,6 +491,8 @@ void AfterLoadVehicles(bool part_of_load)
v->UpdatePosition();
v->UpdateViewport(false);
}
GroupStatistics::UpdateAfterLoad();
}
bool TrainController(Train *v, Vehicle *nomove, bool reverse = true); // From train_cmd.cpp