Changeset - r148:408529bade7a
[Not reviewed]
master
0 1 0
truelight - 20 years ago 2004-09-03 16:03:17
truelight@openttd.org
(svn r149) -Fix: [997703] Junction after tunnel bug (blathijs)
1 file changed with 10 insertions and 4 deletions:
0 comments (0 inline, 0 general)
pathfind.c
Show inline comments
 
@@ -594,11 +594,17 @@ void NTPEnum(NewTrackPathFinder *tpf, ui
 

	
 
restart:
 
	if (IS_TILETYPE(tile, MP_TUNNELBRIDGE) && (_map5[tile] & 0xF0)==0) {
 
		if ( (uint)(_map5[tile] & 3) != direction || ((_map5[tile]>>1)&6) != tpf->tracktype)
 
		/* This is a tunnel tile */
 
		if ( (uint)(_map5[tile] & 3) != (direction ^ 2)) { /* ^ 2 is reversing the direction */
 
			/* We are not just driving out of the tunnel */
 
			if ( (uint)(_map5[tile] & 3) != direction || ((_map5[tile]>>1)&6) != tpf->tracktype)
 
				/* We are not driving into the tunnel, or it
 
				 * is an invalid tunnel */
 
				goto popnext;
 
		flotr = FindLengthOfTunnel(tile, direction, tpf->tracktype);
 
		si.cur_length += flotr.length;
 
		tile = flotr.tile;
 
			flotr = FindLengthOfTunnel(tile, direction, tpf->tracktype);
 
			si.cur_length += flotr.length;
 
			tile = flotr.tile;
 
		}
 
	}
 

	
 
	// remember the start tile so we know if we're in an inf loop.
0 comments (0 inline, 0 general)