summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-01-19 08:24:38 +0000
committerrubidium <rubidium@openttd.org>2011-01-19 08:24:38 +0000
commit922d60f51632872b9bad2e5cb581597164f6ee16 (patch)
tree9e839633990c24405056a11de0b6f3020d9c025c /src
parent9ca4b629cd91c2749d9efafd752fc5175ebce5fd (diff)
downloadopenttd-922d60f51632872b9bad2e5cb581597164f6ee16.tar.xz
(svn r21847) -Fix [FS#4423]: slowing down of trains was done by reducing the speed by 10%, but also when you're just 1% too fast, so limit the slowdown till the new maximum speed
Diffstat (limited to 'src')
-rw-r--r--src/train_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 93d91f4c3..fe8f28b5d 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -2635,7 +2635,7 @@ int Train::UpdateSpeed()
{
int tempmax = max_speed;
if (this->cur_speed > max_speed) {
- tempmax = this->cur_speed - (this->cur_speed / 10) - 1;
+ tempmax = max(this->cur_speed - (this->cur_speed / 10) - 1, tempmax);
}
/* Force a minimum speed of 1 km/h when realistic acceleration is on and the train is not braking. */
int min_speed = (_settings_game.vehicle.train_acceleration_model == AM_ORIGINAL || this->GetAccelerationStatus() == AS_BRAKE) ? 0 : 2;