From af42610321be880879f00753c0ead19352495b63 Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 6 Mar 2006 20:55:24 +0000 Subject: (svn r3777) Add some functions to handle tunnels --- train_cmd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'train_cmd.c') 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 -- cgit v1.2.3-54-g00ecf