mirror of https://github.com/OpenTTD/OpenTTD.git
(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
This commit is contained in:
parent
9ca4b629cd
commit
922d60f516
|
@ -2635,7 +2635,7 @@ int Train::UpdateSpeed()
|
||||||
{
|
{
|
||||||
int tempmax = max_speed;
|
int tempmax = max_speed;
|
||||||
if (this->cur_speed > 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. */
|
/* 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;
|
int min_speed = (_settings_game.vehicle.train_acceleration_model == AM_ORIGINAL || this->GetAccelerationStatus() == AS_BRAKE) ? 0 : 2;
|
||||||
|
|
Loading…
Reference in New Issue