(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:
@@ -1010,7 +1010,7 @@ static void DoTriggerVehicle(Vehicle *v, VehicleTrigger trigger, byte base_rando
|
||||
* 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:
|
||||
|
Reference in New Issue
Block a user