mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 18:40:29 +00:00
(svn r21218) -Fix (r21189)[FS#4236]: don't force a minimum speed when braking
This commit is contained in:
parent
33281491b1
commit
8578ec7496
@ -2806,8 +2806,8 @@ int Train::UpdateSpeed()
|
|||||||
if (this->cur_speed > max_speed) {
|
if (this->cur_speed > max_speed) {
|
||||||
tempmax = this->cur_speed - (this->cur_speed / 10) - 1;
|
tempmax = this->cur_speed - (this->cur_speed / 10) - 1;
|
||||||
}
|
}
|
||||||
/* Force a minimum speed of 1 km/h when realistic acceleration is on. */
|
/* 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) ? 0 : 2;
|
int min_speed = (_settings_game.vehicle.train_acceleration_model == AM_ORIGINAL || this->GetAccelerationStatus() == AS_BRAKE) ? 0 : 2;
|
||||||
this->cur_speed = spd = Clamp(this->cur_speed + ((int)spd >> 8), min_speed, tempmax);
|
this->cur_speed = spd = Clamp(this->cur_speed + ((int)spd >> 8), min_speed, tempmax);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user