(svn r13086) -Fix: do not crash badly after loading a newgrf with engines in-game that often
--- a/src/engine.cpp Wed May 14 03:34:17 2008 +0000
+++ b/src/engine.cpp Wed May 14 15:29:48 2008 +0000
@@ -141,6 +141,9 @@
qsort(&((*el)[begin]), num_items, sizeof(EngineID), compare);
}
+
+/** Sets cached values in Player::num_vehicles and Group::num_vehicles
+ */
void SetCachedEngineCounts()
{
uint engines = GetEnginePoolSize();
--- a/src/openttd.cpp Wed May 14 03:34:17 2008 +0000
+++ b/src/openttd.cpp Wed May 14 15:29:48 2008 +0000
@@ -2538,6 +2538,7 @@
ResetVehiclePosHash();
AfterLoadVehicles(false);
StartupEngines();
+ SetCachedEngineCounts();
/* update station and waypoint graphics */
AfterLoadWaypoints();
AfterLoadStations();