mirror of https://github.com/OpenTTD/OpenTTD
(svn r13086) -Fix: do not crash badly after loading a newgrf with engines in-game that often
parent
044f385f9c
commit
f64c4fc4fb
|
@ -141,6 +141,9 @@ void EngList_SortPartial(EngineList *el, EngList_SortTypeFunction compare, uint
|
||||||
qsort(&((*el)[begin]), num_items, sizeof(EngineID), compare);
|
qsort(&((*el)[begin]), num_items, sizeof(EngineID), compare);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Sets cached values in Player::num_vehicles and Group::num_vehicles
|
||||||
|
*/
|
||||||
void SetCachedEngineCounts()
|
void SetCachedEngineCounts()
|
||||||
{
|
{
|
||||||
uint engines = GetEnginePoolSize();
|
uint engines = GetEnginePoolSize();
|
||||||
|
|
|
@ -2538,6 +2538,7 @@ void ReloadNewGRFData()
|
||||||
ResetVehiclePosHash();
|
ResetVehiclePosHash();
|
||||||
AfterLoadVehicles(false);
|
AfterLoadVehicles(false);
|
||||||
StartupEngines();
|
StartupEngines();
|
||||||
|
SetCachedEngineCounts();
|
||||||
/* update station and waypoint graphics */
|
/* update station and waypoint graphics */
|
||||||
AfterLoadWaypoints();
|
AfterLoadWaypoints();
|
||||||
AfterLoadStations();
|
AfterLoadStations();
|
||||||
|
|
Loading…
Reference in New Issue