diff options
author | frosch <frosch@openttd.org> | 2011-10-03 17:20:56 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-10-03 17:20:56 +0000 |
commit | b78a459613320d5c45052ece08de55a574104530 (patch) | |
tree | 2f7f748ab13f9368ae53d735f5129ea110c407d5 /src/engine.cpp | |
parent | b6766c2ed5fa7e3cb703e1dcfdeacb26cde7d07e (diff) | |
download | openttd-b78a459613320d5c45052ece08de55a574104530.tar.xz |
(svn r22977) -Codechange: Rename SetCachedEngineCounts() to GroupStatistics::UpdateAfterLoad().
Diffstat (limited to 'src/engine.cpp')
-rw-r--r-- | src/engine.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index 6f5ea40a8..f4474ea27 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -461,45 +461,6 @@ bool EngineOverrideManager::ResetToCurrentNewGRFConfig() } /** - * Sets cached values in Company::num_vehicles and Group::num_vehicles - */ -void SetCachedEngineCounts() -{ - size_t engines = Engine::GetPoolSize(); - - /* Set up the engine count for all companies */ - Company *c; - FOR_ALL_COMPANIES(c) { - free(c->num_engines); - c->num_engines = CallocT<EngineID>(engines); - } - - /* Recalculate */ - Group *g; - FOR_ALL_GROUPS(g) { - g->statistics.Clear(); - } - - const Vehicle *v; - FOR_ALL_VEHICLES(v) { - if (!v->IsEngineCountable()) continue; - - assert(v->engine_type < engines); - - Company::Get(v->owner)->num_engines[v->engine_type]++; - - if (v->group_id == DEFAULT_GROUP) continue; - - g = Group::Get(v->group_id); - assert(v->type == g->vehicle_type); - assert(v->owner == g->owner); - - g->statistics.num_engines[v->engine_type]++; - if (v->IsPrimaryVehicle()) g->statistics.num_vehicle++; - } -} - -/** * Initialise the engine pool with the data from the original vehicles. */ void SetupEngines() |