(svn r149) -Fix: [997703] Junction after tunnel bug (blathijs)
This commit is contained in:
		@@ -594,12 +594,18 @@ void NTPEnum(NewTrackPathFinder *tpf, uint tile, uint direction)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
restart:
 | 
					restart:
 | 
				
			||||||
	if (IS_TILETYPE(tile, MP_TUNNELBRIDGE) && (_map5[tile] & 0xF0)==0) {
 | 
						if (IS_TILETYPE(tile, MP_TUNNELBRIDGE) && (_map5[tile] & 0xF0)==0) {
 | 
				
			||||||
 | 
							/* 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)
 | 
								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;
 | 
									goto popnext;
 | 
				
			||||||
			flotr = FindLengthOfTunnel(tile, direction, tpf->tracktype);
 | 
								flotr = FindLengthOfTunnel(tile, direction, tpf->tracktype);
 | 
				
			||||||
			si.cur_length += flotr.length;
 | 
								si.cur_length += flotr.length;
 | 
				
			||||||
			tile = flotr.tile;
 | 
								tile = flotr.tile;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// remember the start tile so we know if we're in an inf loop.
 | 
						// remember the start tile so we know if we're in an inf loop.
 | 
				
			||||||
	tile_org = tile;
 | 
						tile_org = tile;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user