mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
Fix PBS reservation from bridge/tunnel exit when next tile not a junction.
This commit is contained in:
parent
35b93a42ac
commit
7e4898ad42
@ -3219,6 +3219,14 @@ static bool CheckTrainStayInWormHolePathReserve(Train *t, TileIndex tile)
|
||||
{
|
||||
TileIndex veh_orig = t->tile;
|
||||
t->tile = tile;
|
||||
CFollowTrackRail ft(GetTileOwner(tile), GetRailTypeInfo(t->railtype)->compatible_railtypes);
|
||||
if (ft.Follow(t->tile, DiagDirToDiagTrackdir(ReverseDiagDir(GetTunnelBridgeDirection(tile))))) {
|
||||
TrackdirBits reserved = ft.m_new_td_bits & TrackBitsToTrackdirBits(GetReservedTrackbits(ft.m_new_tile));
|
||||
if (reserved == TRACKDIR_BIT_NONE) {
|
||||
/* next tile is not reserved, so reserve the exit tile */
|
||||
SetTunnelBridgeReservation(tile, true);
|
||||
}
|
||||
}
|
||||
bool ok = TryPathReserve(t);
|
||||
t->tile = veh_orig;
|
||||
return ok;
|
||||
|
Loading…
Reference in New Issue
Block a user