summaryrefslogtreecommitdiff
path: root/tunnel_map.h
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 /tunnel_map.h
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 'tunnel_map.h')
-rw-r--r--tunnel_map.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/tunnel_map.h b/tunnel_map.h
index 047f631f9..6ac6cb44b 100644
--- a/tunnel_map.h
+++ b/tunnel_map.h
@@ -9,6 +9,18 @@
#include "rail.h"
+static inline bool IsTunnel(TileIndex t)
+{
+ return !HASBIT(_m[t].m5, 7);
+}
+
+
+static inline bool IsTunnelTile(TileIndex t)
+{
+ return IsTileType(t, MP_TUNNELBRIDGE) && IsTunnel(t);
+}
+
+
static inline DiagDirection GetTunnelDirection(TileIndex t)
{
return (DiagDirection)GB(_m[t].m5, 0, 2);