diff --git a/src/pathfinder/yapf/yapf_costrail.hpp b/src/pathfinder/yapf/yapf_costrail.hpp index a63166e719..2169429131 100644 --- a/src/pathfinder/yapf/yapf_costrail.hpp +++ b/src/pathfinder/yapf/yapf_costrail.hpp @@ -215,6 +215,8 @@ private: if (IsRailDepotTile(v->tile)) { candidate_tile = v->tile; + } else if (v->track & TRACK_BIT_WORMHOLE && IsTileType(v->tile, MP_TUNNELBRIDGE) && IsTunnelBridgeSignalSimulationExit(v->tile) && IsTunnelBridgePBS(v->tile)) { + candidate_tile = v->tile; } CFollowTrackRail ft(v); diff --git a/src/pbs.cpp b/src/pbs.cpp index b9193d9933..afe27207b3 100644 --- a/src/pbs.cpp +++ b/src/pbs.cpp @@ -448,6 +448,9 @@ TileIndex VehiclePosTraceRestrictPreviousSignalCallback(const Train *v, const vo if (IsRailDepotTile(v->tile)) { return v->tile; } + if (v->track & TRACK_BIT_WORMHOLE && IsTileType(v->tile, MP_TUNNELBRIDGE) && IsTunnelBridgeSignalSimulationExit(v->tile) && IsTunnelBridgePBS(v->tile)) { + return v->tile; + } // scan forwards from vehicle position, for the case that train is waiting at/approaching PBS signal diff --git a/src/tracerestrict_gui.cpp b/src/tracerestrict_gui.cpp index 9ffec662e8..1891443cb8 100644 --- a/src/tracerestrict_gui.cpp +++ b/src/tracerestrict_gui.cpp @@ -1876,6 +1876,8 @@ public: if (IsRailDepotTile(tile)) { // OK + } else if (IsTileType(tile, MP_TUNNELBRIDGE) && IsTunnelBridgeWithSignalSimulation(tile)) { + // OK } else { if (!IsPlainRailTile(tile)) { ShowErrorMessage(error_message, STR_ERROR_THERE_IS_NO_RAILROAD_TRACK, WL_INFO);