mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
Slightly overestimate descents when deciding if reservation long enough
This commit is contained in:
parent
8cf2b827a1
commit
4386da53ee
@ -3785,7 +3785,9 @@ static bool IsReservationLookAheadLongEnough(const Train *v, const ChooseTrainTr
|
||||
}
|
||||
|
||||
if (found_signal) {
|
||||
int64 distance = GetRealisticBrakingDistanceForSpeed(stats, signal_speed, 0, v->lookahead->reservation_end_z - signal_z);
|
||||
int delta_z = v->lookahead->reservation_end_z - signal_z;
|
||||
delta_z += (delta_z >> 2); // Slightly overestimate slope changes to compensate for non-uniform descents
|
||||
int64 distance = GetRealisticBrakingDistanceForSpeed(stats, signal_speed, 0, delta_z);
|
||||
if (signal_position + distance <= v->lookahead->reservation_end_position) return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user