summaryrefslogtreecommitdiff
path: root/rail.c
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2006-12-27 12:38:02 +0000
committercelestar <celestar@openttd.org>2006-12-27 12:38:02 +0000
commitd95e2c2dd10a0dfc1704962a68a2bd32b635d158 (patch)
tree28100daed109de06e979123edd0601487ecc8261 /rail.c
parentd92103d6ff97ae413e2e6eae602e04b05addaf17 (diff)
downloadopenttd-d95e2c2dd10a0dfc1704962a68a2bd32b635d158.tar.xz
(svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
Diffstat (limited to 'rail.c')
-rw-r--r--rail.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/rail.c b/rail.c
index 5b6650667..c4b20de27 100644
--- a/rail.c
+++ b/rail.c
@@ -104,7 +104,6 @@ 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);
@@ -120,26 +119,9 @@ RailType GetTileRailType(TileIndex tile, Trackdir trackdir)
case MP_TUNNELBRIDGE:
if (IsTunnel(tile)) {
- if (GetTunnelTransportType(tile) == TRANSPORT_RAIL) {
- return GetRailType(tile);
- }
+ if (GetTunnelTransportType(tile) == TRANSPORT_RAIL) return GetRailType(tile);
} else {
- 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);
- }
- }
- }
+ if (GetBridgeTransportType(tile) == TRANSPORT_RAIL) return GetRailType(tile);
}
break;