diff options
author | rubidium <rubidium@openttd.org> | 2011-01-19 08:24:38 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-01-19 08:24:38 +0000 |
commit | 922d60f51632872b9bad2e5cb581597164f6ee16 (patch) | |
tree | 9e839633990c24405056a11de0b6f3020d9c025c | |
parent | 9ca4b629cd91c2749d9efafd752fc5175ebce5fd (diff) | |
download | openttd-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
-rw-r--r-- | src/train_cmd.cpp | 2 |
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; |