mirror of https://github.com/OpenTTD/OpenTTD
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
parent
ac1e2ef077
commit
021817aa61
|
@ -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. */
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue