Changeset - r17990:bab425a00bef
[Not reviewed]
master
0 1 0
rubidium - 13 years ago 2011-08-22 11:47:15
rubidium@openttd.org
(svn r22809) -Fix [FS#4731]: towns expanding from the "wrong" side of a tunnel or bridge
1 file changed with 8 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/town_cmd.cpp
Show inline comments
 
@@ -1236,9 +1236,14 @@ static int GrowTownAtRoad(Town *t, TileI
 
			return _grow_town_result;
 
		}
 

	
 
		/* Select a random bit from the blockmask, walk a step
 
		 * and continue the search from there. */
 
		do target_dir = RandomDiagDir(); while (!(cur_rb & DiagDirToRoadBits(target_dir)));
 
		if (IsTileType(tile, MP_TUNNELBRIDGE)) {
 
			/* Only build in the direction away from the tunnel or bridge. */
 
			target_dir = ReverseDiagDir(GetTunnelBridgeDirection(tile));
 
		} else {
 
			/* Select a random bit from the blockmask, walk a step
 
			 * and continue the search from there. */
 
			do target_dir = RandomDiagDir(); while (!(cur_rb & DiagDirToRoadBits(target_dir)));
 
		}
 
		tile = TileAddByDiagDir(tile, target_dir);
 

	
 
		if (IsTileType(tile, MP_ROAD) && !IsRoadDepot(tile) && HasTileRoadType(tile, ROADTYPE_ROAD)) {
0 comments (0 inline, 0 general)