summaryrefslogtreecommitdiff
path: root/src/road_map.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-03-22 10:56:08 +0000
committerrubidium <rubidium@openttd.org>2008-03-22 10:56:08 +0000
commitf0538b4b622a80a93d27e7dc9f1cb05620eebb90 (patch)
treec70cc515d076c09e820b06aa4af1dbdb1fe37307 /src/road_map.cpp
parent5d747802f28d6fd6ad2527aa04f418ce09c00f6c (diff)
downloadopenttd-f0538b4b622a80a93d27e7dc9f1cb05620eebb90.tar.xz
(svn r12390) -Fix [FS#1851]: trams failing to turn on bridge heads/tunnel entrances.
Diffstat (limited to 'src/road_map.cpp')
-rw-r--r--src/road_map.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/road_map.cpp b/src/road_map.cpp
index 2d236b504..a39fa5fc9 100644
--- a/src/road_map.cpp
+++ b/src/road_map.cpp
@@ -14,7 +14,7 @@
#include "tunnelbridge_map.h"
-RoadBits GetAnyRoadBits(TileIndex tile, RoadType rt)
+RoadBits GetAnyRoadBits(TileIndex tile, RoadType rt, bool straight_tunnel_bridge_entrance)
{
if (!HasTileRoadType(tile, rt)) return ROAD_NONE;
@@ -34,7 +34,9 @@ RoadBits GetAnyRoadBits(TileIndex tile, RoadType rt)
case MP_TUNNELBRIDGE:
if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) return ROAD_NONE;
- return DiagDirToRoadBits(ReverseDiagDir(GetTunnelBridgeDirection(tile)));
+ return straight_tunnel_bridge_entrance ?
+ AxisToRoadBits(DiagDirToAxis(GetTunnelBridgeDirection(tile))) :
+ DiagDirToRoadBits(ReverseDiagDir(GetTunnelBridgeDirection(tile)));
default: return ROAD_NONE;
}