Mercurial > hg > openttd
changeset 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 | 266a75e54b50 |
children | 77a5708ac3f8 |
files | src/newgrf_engine.cpp src/vehicle.cpp |
diffstat | 2 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -1010,7 +1010,7 @@ * i.e.), so we give them all the NEW_CARGO triggered * vehicle's portion of random bits. */ assert(first); - DoTriggerVehicle(GetFirstVehicleInChain(v), VEHICLE_TRIGGER_ANY_NEW_CARGO, new_random_bits, false); + DoTriggerVehicle((v->type == VEH_Train) ? GetFirstVehicleInChain(v) : v, VEHICLE_TRIGGER_ANY_NEW_CARGO, new_random_bits, false); break; case VEHICLE_TRIGGER_DEPOT: