diff options
author | planetmaker <planetmaker@openttd.org> | 2015-04-09 18:17:43 +0000 |
---|---|---|
committer | planetmaker <planetmaker@openttd.org> | 2015-04-09 18:17:43 +0000 |
commit | 55f42eaa1fa202476d7b9e011330c433209ba978 (patch) | |
tree | 16d88bc2b2c4707c688716595c818603d56dc481 /src | |
parent | 983abcef4ef4b0241df45c35de6b8493565e8b11 (diff) | |
download | openttd-55f42eaa1fa202476d7b9e011330c433209ba978.tar.xz |
(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.
Diffstat (limited to 'src')
-rw-r--r-- | src/vehicle.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index d54c627a0..46f98fe63 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2414,7 +2414,9 @@ void Vehicle::ShowVisualEffect() const 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: @@ -2423,14 +2425,10 @@ void Vehicle::ShowVisualEffect() const */ 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; |