diff --git a/src/engine.cpp b/src/engine.cpp index 818cd2d6e9..4a548b9677 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -141,6 +141,9 @@ void EngList_SortPartial(EngineList *el, EngList_SortTypeFunction compare, uint qsort(&((*el)[begin]), num_items, sizeof(EngineID), compare); } + +/** Sets cached values in Player::num_vehicles and Group::num_vehicles + */ void SetCachedEngineCounts() { uint engines = GetEnginePoolSize(); diff --git a/src/openttd.cpp b/src/openttd.cpp index f32d338d60..e79b166fcd 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -2538,6 +2538,7 @@ void ReloadNewGRFData() ResetVehiclePosHash(); AfterLoadVehicles(false); StartupEngines(); + SetCachedEngineCounts(); /* update station and waypoint graphics */ AfterLoadWaypoints(); AfterLoadStations();