Changeset - r5826:84618d25ce1d
[Not reviewed]
master
0 1 0
tron - 17 years ago 2007-01-24 17:58:07
tron@openttd.org
(svn r8392) -Fix

Use HASBIT() instead of implementing it manually
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/yapf/follow_track.hpp
Show inline comments
 
@@ -163,25 +163,25 @@ protected:
 
				return false;
 
		}
 

	
 
		// rail transport is possible only on tiles with the same owner as vehicle
 
		if (IsRailTT() && GetTileOwner(m_new_tile) != m_veh->owner) {
 
			// different owner
 
			return false;
 
		}
 

	
 
		// rail transport is possible only on compatible rail types
 
		if (IsRailTT()) {
 
			RailType rail_type = GetTileRailType(m_new_tile, TrackdirToTrack(DiagdirToDiagTrackdir(m_exitdir)));
 
			if (((1 << rail_type) & m_veh->u.rail.compatible_railtypes) == 0) {
 
			if (!HASBIT(m_veh->u.rail.compatible_railtypes, rail_type)) {
 
				// incompatible rail type
 
				return false;
 
			}
 
		}
 

	
 
		// tunnel holes and bridge ramps can be entered only from proper direction
 
		if (!IsWaterTT() && IsTileType(m_new_tile, MP_TUNNELBRIDGE)) {
 
			if (IsTunnel(m_new_tile)) {
 
				if (!m_is_tunnel) {
 
					DiagDirection tunnel_enterdir = GetTunnelDirection(m_new_tile);
 
					if (tunnel_enterdir != m_exitdir) return false;
 
				}
0 comments (0 inline, 0 general)