diff options
author | tron <tron@openttd.org> | 2006-03-06 20:55:24 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-03-06 20:55:24 +0000 |
commit | f2dc736554c06d69dd936131c4a09ddbc6b58083 (patch) | |
tree | 14ef1d7e7e885dff603aa06189b416a7bd2a6ae0 /train_cmd.c | |
parent | 2d3c28f2b3d24c2b01e54a51e2dcf5ad7f4851c8 (diff) | |
download | openttd-f2dc736554c06d69dd936131c4a09ddbc6b58083.tar.xz |
(svn r3777) Add some functions to handle tunnels
Diffstat (limited to 'train_cmd.c')
-rw-r--r-- | train_cmd.c | 5 |
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 |