Changeset - r22058:29499fa4947f
[Not reviewed]
master
0 1 0
planetmaker - 9 years ago 2015-04-09 18:17:43
planetmaker@openttd.org
(svn r27222) -Fix [FS#6278]: Use the current maximum speed as limited by bridges, orders etc. for all vehicle types alike when considering increased smoke emissions of vehicles.
1 file changed with 4 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/vehicle.cpp
Show inline comments
 
@@ -2411,29 +2411,27 @@ void Vehicle::ShowVisualEffect() const
 
	if (_settings_game.vehicle.smoke_amount == 0 ||
 
			this->vehstatus & (VS_TRAIN_SLOWING | VS_STOPPED) ||
 
			this->cur_speed < 2) {
 
		return;
 
	}
 

	
 
	uint max_speed = this->vcache.cached_max_speed;
 
	/* Use the speed as limited by underground and orders. */
 
	uint max_speed = this->GetCurrentMaxSpeed();
 

	
 
	if (this->type == VEH_TRAIN) {
 
		const Train *t = Train::From(this);
 
		/* 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
 
		 */
 
		if (HasBit(t->flags, VRF_REVERSING) ||
 
				(IsRailStationTile(t->tile) && t->IsFrontEngine() && t->current_order.ShouldStopAtStation(t, GetStationIndex(t->tile)) &&
 
				t->cur_speed >= t->Train::GetCurrentMaxSpeed())) {
 
				t->cur_speed >= max_speed)) {
 
			return;
 
		}
 

	
 
		max_speed = min(max_speed, t->gcache.cached_max_track_speed);
 
		max_speed = min(max_speed, this->current_order.GetMaxSpeed());
 
	}
 
	if (this->type == VEH_ROAD || this->type == VEH_SHIP) max_speed = min(max_speed, this->current_order.GetMaxSpeed() * 2);
 

	
 
	const Vehicle *v = this;
 

	
 
	do {
 
		bool advanced = HasBit(v->vcache.cached_vis_effect, VE_ADVANCED_EFFECT);
 
		int effect_offset = GB(v->vcache.cached_vis_effect, VE_OFFSET_START, VE_OFFSET_COUNT) - VE_OFFSET_CENTRE;
0 comments (0 inline, 0 general)