Changeset - r3498:b273d3047073
[Not reviewed]
master
0 2 0
tron - 18 years ago 2006-04-10 20:46:37
tron@openttd.org
(svn r4349) Remove GetCrossingTransportType(), it's slightly overkill
2 files changed with 3 insertions and 21 deletions:
npf.c
3
1
rail.h
20
0 comments (0 inline, 0 general)
npf.c
Show inline comments
 
@@ -467,8 +467,10 @@ static bool VehicleMayEnterTile(Owner ow
 
	switch (GetTileType(tile)) {
 
		case MP_STREET:
 
			/* rail-road crossing : are we looking at the railway part? */
 
			if (IsLevelCrossing(tile) && GetCrossingTransportType(tile, TrackdirToTrack(DiagdirToDiagTrackdir(enterdir))) == TRANSPORT_RAIL)
 
			if (IsLevelCrossing(tile) &&
 
					DiagDirToAxis(enterdir) != GetCrossingRoadAxis(tile)) {
 
				return IsTileOwner(tile, owner); /* Railway needs owner check, while the street is public */
 
			}
 
			break;
 

	
 
		case MP_TUNNELBRIDGE:
rail.h
Show inline comments
 
@@ -430,26 +430,6 @@ RailType GetTileRailType(TileIndex tile,
 

	
 

	
 
/**
 
 * Gets the transport type of the given track on the given crossing tile.
 
 * @return  The transport type of the given track, either TRANSPORT_ROAD,
 
 * TRANSPORT_RAIL.
 
 */
 
static inline TransportType GetCrossingTransportType(TileIndex tile, Track track)
 
{
 
	/* XXX: Nicer way to write this? */
 
	switch (track) {
 
		/* When map5 bit 3 is set, the road runs in the y direction */
 
		case TRACK_X:
 
			return (HASBIT(_m[tile].m5, 3) ? TRANSPORT_RAIL : TRANSPORT_ROAD);
 
		case TRACK_Y:
 
			return (HASBIT(_m[tile].m5, 3) ? TRANSPORT_ROAD : TRANSPORT_RAIL);
 
		default:
 
			assert(0);
 
	}
 
	return INVALID_TRANSPORT;
 
}
 

	
 
/**
 
 * Returns a pointer to the Railtype information for a given railtype
 
 * @param railtype the rail type which the information is requested for
 
 * @return The pointer to the RailtypeInfo
0 comments (0 inline, 0 general)