summaryrefslogtreecommitdiff
path: root/rail.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-12 15:04:03 +0000
committertron <tron@openttd.org>2006-03-12 15:04:03 +0000
commit78083f0da7b7c94eccea15eec397e2afe96da1d5 (patch)
treefa4485d2814de5612a416a86e22ba7d60ce70f9f /rail.c
parentb394f72fa9305094ddf672564a0f4a0c8f16e89b (diff)
downloadopenttd-78083f0da7b7c94eccea15eec397e2afe96da1d5.tar.xz
(svn r3830) Move IsTunnelTile() from tile.h to tunnel_map.h and add IsTunnel(), which just checks for a tunnel, but not the tile type as IsTunnelTile() does
Diffstat (limited to 'rail.c')
-rw-r--r--rail.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/rail.c b/rail.c
index 43ce2e812..6975b5f93 100644
--- a/rail.c
+++ b/rail.c
@@ -4,6 +4,7 @@
#include "openttd.h"
#include "rail.h"
#include "station.h"
+#include "tunnel_map.h"
/* XXX: Below 3 tables store duplicate data. Maybe remove some? */
/* Maps a trackdir to the bit that stores its status in the map arrays, in the
@@ -123,8 +124,9 @@ RailType GetTileRailType(TileIndex tile, Trackdir trackdir)
type = _m[tile].m3 & RAILTYPE_MASK;
break;
case MP_TUNNELBRIDGE:
- /* railway tunnel */
- if ((_m[tile].m5 & 0xFC) == 0) type = _m[tile].m3 & RAILTYPE_MASK;
+ if (IsTunnel(tile) && GetTunnelTransportType(tile) == TRANSPORT_RAIL) {
+ return _m[tile].m3 & RAILTYPE_MASK;
+ }
/* railway bridge ending */
if ((_m[tile].m5 & 0xC6) == 0x80) type = _m[tile].m3 & RAILTYPE_MASK;
/* on railway bridge */