summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2012-02-14 17:04:06 +0000
committermichi_cc <michi_cc@openttd.org>2012-02-14 17:04:06 +0000
commitf2c694c8fbfb775dc239ab1c6447d3744d1c84c7 (patch)
treeaf7e8b3e3689ad2e9e0db8ef56a8c7ea7521b373 /src/roadveh_cmd.cpp
parent347157cb8ce016428275d6143b555de1dc802133 (diff)
downloadopenttd-f2c694c8fbfb775dc239ab1c6447d3744d1c84c7.tar.xz
(svn r23947) -Feature: Timetabled maximum travel speeds for non-flying vehicles.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 0c0157ab1..6a8225050 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -416,7 +416,7 @@ void RoadVehicle::UpdateDeltaXY(Direction direction)
*/
inline int RoadVehicle::GetCurrentMaxSpeed() const
{
- if (_settings_game.vehicle.roadveh_acceleration_model == AM_ORIGINAL) return this->vcache.cached_max_speed;
+ if (_settings_game.vehicle.roadveh_acceleration_model == AM_ORIGINAL) return min(this->vcache.cached_max_speed, this->current_order.max_speed * 2);
int max_speed = this->vcache.cached_max_speed;
@@ -430,7 +430,7 @@ inline int RoadVehicle::GetCurrentMaxSpeed() const
}
}
- return max_speed;
+ return min(max_speed, this->current_order.max_speed * 2);
}
/**