mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r11733) -Fix: Max speed for entering stations overrode the max speed of curves
This commit is contained in:
parent
a967a7287f
commit
a8611311ac
@ -368,15 +368,16 @@ static int GetTrainAcceleration(Vehicle *v, bool mode)
|
|||||||
if (IsTileType(v->tile, MP_STATION) && IsFrontEngine(v)) {
|
if (IsTileType(v->tile, MP_STATION) && IsFrontEngine(v)) {
|
||||||
if (TrainShouldStop(v, v->tile)) {
|
if (TrainShouldStop(v, v->tile)) {
|
||||||
int station_length = GetStationByTile(v->tile)->GetPlatformLength(v->tile, DirToDiagDir(v->direction));
|
int station_length = GetStationByTile(v->tile)->GetPlatformLength(v->tile, DirToDiagDir(v->direction));
|
||||||
int delta_v;
|
|
||||||
|
|
||||||
max_speed = 120;
|
int st_max_speed = 120;
|
||||||
|
|
||||||
delta_v = v->cur_speed / (station_length + 1);
|
int delta_v = v->cur_speed / (station_length + 1);
|
||||||
if (v->max_speed > (v->cur_speed - delta_v))
|
if (v->max_speed > (v->cur_speed - delta_v)) {
|
||||||
max_speed = v->cur_speed - (delta_v / 10);
|
st_max_speed = v->cur_speed - (delta_v / 10);
|
||||||
|
}
|
||||||
|
|
||||||
max_speed = max(max_speed, 25 * station_length);
|
st_max_speed = max(st_max_speed, 25 * station_length);
|
||||||
|
max_speed = min(max_speed, st_max_speed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user