(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:
rubidium 2011-01-19 08:24:38 +00:00
parent 9ca4b629cd
commit 922d60f516
1 changed files with 1 additions and 1 deletions

View File

@ -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;