summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-06 20:55:24 +0000
committertron <tron@openttd.org>2006-03-06 20:55:24 +0000
commitaf42610321be880879f00753c0ead19352495b63 (patch)
tree14ef1d7e7e885dff603aa06189b416a7bd2a6ae0 /train_cmd.c
parent49cb8eb470a886dcfebd827dec1fcd8a55c2dffb (diff)
downloadopenttd-af42610321be880879f00753c0ead19352495b63.tar.xz
(svn r3777) Add some functions to handle tunnels
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 291c2ea01..4d0f434ae 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -8,6 +8,7 @@
#include "table/strings.h"
#include "map.h"
#include "tile.h"
+#include "tunnel_map.h"
#include "vehicle.h"
#include "command.h"
#include "pathfind.h"
@@ -3121,8 +3122,10 @@ static bool TrainCheckIfLineEnds(Vehicle *v)
tile = v->tile;
// tunnel entrance?
- if (IsTunnelTile(tile) && DiagDirToDir(GB(_m[tile].m5, 0, 2)) == v->direction)
+ if (IsTunnelTile(tile) &&
+ DiagDirToDir(GetTunnelDirection(tile)) == v->direction) {
return true;
+ }
// depot?
/* XXX -- When enabled, this makes it possible to crash trains of others