(svn r8744) -Fix(r654/2105): Call GetFirstVehicleInChain only for trains, and assert the vehicle type in that function. Not a critical error, but it does increase game performance by up to 10% when playing a large game (many vehicles) with aircraft/road vehicle newgrfs loaded.

This commit is contained in:
celestar
2007-02-15 10:21:00 +00:00
parent f6b917f609
commit 6abbf15a8e
2 changed files with 2 additions and 1 deletions

View File

@@ -515,6 +515,7 @@ Vehicle *GetFirstVehicleInChain(const Vehicle *v)
Vehicle* u;
assert(v != NULL);
assert(v->type == VEH_Train);
if (v->first != NULL) {
if (IsFrontEngine(v->first) || IsFreeWagon(v->first)) return v->first;