diff src/vehicle.cpp @ 6021:3cfdf096e874 draft

(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.
author celestar <celestar@openttd.org>
date Thu, 15 Feb 2007 10:21:00 +0000
parents 542153c1c803
children 5a275eda5f1e
line wrap: on
line diff
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -515,6 +515,7 @@
 	Vehicle* u;
 
 	assert(v != NULL);
+	assert(v->type == VEH_Train);
 
 	if (v->first != NULL) {
 		if (IsFrontEngine(v->first) || IsFreeWagon(v->first)) return v->first;