Fix excessive amounts of vehicle smoke when reversing at waypoints.
This commit is contained in:
@@ -2395,6 +2395,8 @@ static void SpawnAdvancedVisualEffect(const Vehicle *v)
|
||||
}
|
||||
}
|
||||
|
||||
uint16 ReversingDistanceTargetSpeed(const Train *v);
|
||||
|
||||
/**
|
||||
* Draw visual effects (smoke and/or sparks) for a vehicle chain.
|
||||
* @pre this->IsPrimaryVehicle()
|
||||
@@ -2423,10 +2425,12 @@ void Vehicle::ShowVisualEffect() const
|
||||
/* For trains, do not show any smoke when:
|
||||
* - the train is reversing
|
||||
* - is entering a station with an order to stop there and its speed is equal to maximum station entering speed
|
||||
* - is approaching a reversing point and its speed is equal to maximum approach speed
|
||||
*/
|
||||
if (HasBit(t->flags, VRF_REVERSING) ||
|
||||
(IsRailStationTile(t->tile) && t->IsFrontEngine() && t->current_order.ShouldStopAtStation(t, GetStationIndex(t->tile)) &&
|
||||
t->cur_speed >= max_speed)) {
|
||||
t->cur_speed >= max_speed) ||
|
||||
(t->reverse_distance >= 1 && t->cur_speed >= ReversingDistanceTargetSpeed(t))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user