(svn r3777) Add some functions to handle tunnels

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

View File

@@ -5,6 +5,7 @@
#include "functions.h"
#include "road_map.h"
#include "station.h"
#include "tunnel_map.h"
RoadBits GetAnyRoadBits(TileIndex tile)
@@ -36,8 +37,8 @@ RoadBits GetAnyRoadBits(TileIndex tile)
}
} else {
// tunnel
if (GB(_m[tile].m5, 2, 2) != TRANSPORT_ROAD) return 0; // not a road tunnel
return DiagDirToRoadBits(ReverseDiagDir(GB(_m[tile].m5, 0, 2)));
if (GetTunnelTransportType(tile) != TRANSPORT_ROAD) return 0;
return DiagDirToRoadBits(ReverseDiagDir(GetTunnelDirection(tile)));
}
default: return 0;