1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-13 17:49:10 +00:00

(svn r3777) Add some functions to handle tunnels

This commit is contained in:
tron
2006-03-06 20:55:24 +00:00
parent 2d3c28f2b3
commit f2dc736554
11 changed files with 132 additions and 46 deletions

View File

@@ -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