From 922d60f51632872b9bad2e5cb581597164f6ee16 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 19 Jan 2011 08:24:38 +0000 Subject: (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 --- src/train_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3-70-g09d2