train_cmd.c
changeset 3154 6ab0cb6b7ab3
parent 3153 e83501906eae
child 3157 3f35e2d9c8e3
equal deleted inserted replaced
3153:e83501906eae 3154:6ab0cb6b7ab3
     6 #include "functions.h"
     6 #include "functions.h"
     7 #include "gui.h"
     7 #include "gui.h"
     8 #include "table/strings.h"
     8 #include "table/strings.h"
     9 #include "map.h"
     9 #include "map.h"
    10 #include "tile.h"
    10 #include "tile.h"
       
    11 #include "tunnel_map.h"
    11 #include "vehicle.h"
    12 #include "vehicle.h"
    12 #include "command.h"
    13 #include "command.h"
    13 #include "pathfind.h"
    14 #include "pathfind.h"
    14 #include "npf.h"
    15 #include "npf.h"
    15 #include "station.h"
    16 #include "station.h"
  3119 	if (v->u.rail.track & 0x80) return true; // exit if inside a depot
  3120 	if (v->u.rail.track & 0x80) return true; // exit if inside a depot
  3120 
  3121 
  3121 	tile = v->tile;
  3122 	tile = v->tile;
  3122 
  3123 
  3123 	// tunnel entrance?
  3124 	// tunnel entrance?
  3124 	if (IsTunnelTile(tile) && DiagDirToDir(GB(_m[tile].m5, 0, 2)) == v->direction)
  3125 	if (IsTunnelTile(tile) &&
       
  3126 			DiagDirToDir(GetTunnelDirection(tile)) == v->direction) {
  3125 		return true;
  3127 		return true;
       
  3128 	}
  3126 
  3129 
  3127 	// depot?
  3130 	// depot?
  3128 	/* XXX -- When enabled, this makes it possible to crash trains of others
  3131 	/* XXX -- When enabled, this makes it possible to crash trains of others
  3129 	     (by building a depot right against a station) */
  3132 	     (by building a depot right against a station) */
  3130 /*	if (IsTileType(tile, MP_RAILWAY) && (_m[tile].m5 & 0xFC) == 0xC0)
  3133 /*	if (IsTileType(tile, MP_RAILWAY) && (_m[tile].m5 & 0xFC) == 0xC0)