summaryrefslogtreecommitdiff
path: root/rail.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-06-07 19:35:21 +0000
committertron <tron@openttd.org>2006-06-07 19:35:21 +0000
commitbe88e269b918b365695e84cfa962e8d21b98e759 (patch)
tree5a6fb4aa93546ad194301d231de10ba5370ccc6f /rail.c
parentace071529e2116f92aeec50d3bac0f95953b129b (diff)
downloadopenttd-be88e269b918b365695e84cfa962e8d21b98e759.tar.xz
(svn r5155) - Remove the bridge branch merge (revision r5070)
Diffstat (limited to 'rail.c')
-rw-r--r--rail.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/rail.c b/rail.c
index aa2865cb3..5b6650667 100644
--- a/rail.c
+++ b/rail.c
@@ -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;