(svn r22979) -Codechange: Add GroupStatistics::CountEngine().

This commit is contained in:
frosch
2011-10-03 17:22:09 +00:00
parent 68f969282e
commit fafa06e821
3 changed files with 24 additions and 17 deletions

View File

@@ -697,7 +697,7 @@ void Vehicle::PreDestructor()
if (this->owner == _local_company) InvalidateAutoreplaceWindow(this->engine_type, this->group_id);
DeleteGroupHighlightOfVehicle(this);
if (Group::IsValidID(this->group_id)) Group::Get(this->group_id)->statistics.num_engines[this->engine_type]--;
GroupStatistics::CountEngine(this, -1);
if (this->IsPrimaryVehicle()) GroupStatistics::CountVehicle(this, -1);
}