Do not unnecessarily extend train reservations when passing signal

When the signal is a next-only or non-aspect-incrementing type, and
its maximum lookahead is not beyond the current end of the reservation
This commit is contained in:
Jonathan G Rennison
2023-07-23 18:39:57 +01:00
parent d7ef1416a7
commit 4f875012b6
3 changed files with 33 additions and 11 deletions

View File

@@ -164,6 +164,7 @@ bool ValidateLookAhead(const Train *v);
PBSTileInfo FollowTrainReservation(const Train *v, Vehicle **train_on_res = nullptr, FollowTrainReservationFlags flags = FTRF_NONE);
void ApplyAvailableFreeTunnelBridgeTiles(TrainReservationLookAhead *lookahead, int free_tiles, TileIndex tile, TileIndex end);
void TryCreateLookAheadForTrainInTunnelBridge(Train *t);
int AdvanceTrainReservationLookaheadEnd(const Train *v, int lookahead_end_position);
void SetTrainReservationLookaheadEnd(Train *v);
void FillTrainReservationLookAhead(Train *v);
bool TrainReservationPassesThroughTile(const Train *v, TileIndex search_tile);