mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-11 16:54:42 +00:00
(svn r22809) -Fix [FS#4731]: towns expanding from the "wrong" side of a tunnel or bridge
This commit is contained in:
parent
9023de2c1f
commit
4c030468e1
@ -1236,9 +1236,14 @@ static int GrowTownAtRoad(Town *t, TileIndex tile)
|
|||||||
return _grow_town_result;
|
return _grow_town_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Select a random bit from the blockmask, walk a step
|
if (IsTileType(tile, MP_TUNNELBRIDGE)) {
|
||||||
* and continue the search from there. */
|
/* Only build in the direction away from the tunnel or bridge. */
|
||||||
do target_dir = RandomDiagDir(); while (!(cur_rb & DiagDirToRoadBits(target_dir)));
|
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);
|
tile = TileAddByDiagDir(tile, target_dir);
|
||||||
|
|
||||||
if (IsTileType(tile, MP_ROAD) && !IsRoadDepot(tile) && HasTileRoadType(tile, ROADTYPE_ROAD)) {
|
if (IsTileType(tile, MP_ROAD) && !IsRoadDepot(tile) && HasTileRoadType(tile, ROADTYPE_ROAD)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user