diff options
Diffstat (limited to 'rail.c')
-rw-r--r-- | rail.c | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -104,6 +104,7 @@ const Trackdir _dir_to_diag_trackdir[] = { RailType GetTileRailType(TileIndex tile, Trackdir trackdir) { + DiagDirection exitdir = TrackdirToExitdir(trackdir); switch (GetTileType(tile)) { case MP_RAILWAY: return GetRailType(tile); @@ -123,8 +124,21 @@ RailType GetTileRailType(TileIndex tile, Trackdir trackdir) return GetRailType(tile); } } else { - if (GetBridgeTransportType(tile) == TRANSPORT_RAIL) { - return GetRailType(tile); + if (IsBridgeRamp(tile)) { + if (GetBridgeTransportType(tile) == TRANSPORT_RAIL) { + return GetRailType(tile); + } + } else { + if (GetBridgeAxis(tile) == DiagDirToAxis(exitdir)) { + if (GetBridgeTransportType(tile) == TRANSPORT_RAIL) { + return GetRailTypeOnBridge(tile); + } + } else { + if (IsTransportUnderBridge(tile) && + GetTransportTypeUnderBridge(tile) == TRANSPORT_RAIL) { + return GetRailType(tile); + } + } } } break; |