mirror of https://github.com/OpenTTD/OpenTTD
(svn r7718) -Fix (runknown): When pathfinding onto a bridge or tunnel end from
previous tile (but not warping from the opposite end) check the enter direction. This fixes signal setting if a rail ends on the top of a tunnel end.release/0.6
parent
91a59bfd97
commit
47e2dfb318
16
pathfind.c
16
pathfind.c
|
@ -301,6 +301,22 @@ static void TPFMode1(TrackPathFinder* tpf, TileIndex tile, DiagDirection directi
|
||||||
if (IsTileDepotType(tile, TRANSPORT_ROAD) && ReverseDiagDir(GetRoadDepotDirection(tile)) != direction) return;
|
if (IsTileDepotType(tile, TRANSPORT_ROAD) && ReverseDiagDir(GetRoadDepotDirection(tile)) != direction) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check if the new tile is a tunnel or bridge head and that the direction
|
||||||
|
* and transport type match */
|
||||||
|
if (IsTileType(tile, MP_TUNNELBRIDGE)) {
|
||||||
|
if (IsTunnel(tile)) {
|
||||||
|
if (GetTunnelDirection(tile) != direction ||
|
||||||
|
GetTunnelTransportType(tile) != tpf->tracktype) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else if (IsBridge(tile)) {
|
||||||
|
if (GetBridgeRampDirection(tile) != direction ||
|
||||||
|
GetBridgeTransportType(tile) != tpf->tracktype) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tpf->rd.cur_length++;
|
tpf->rd.cur_length++;
|
||||||
|
|
||||||
bits = GetTileTrackStatus(tile, tpf->tracktype);
|
bits = GetTileTrackStatus(tile, tpf->tracktype);
|
||||||
|
|
Loading…
Reference in New Issue