diff options
author | Tyler Trahan <tyler@tylertrahan.com> | 2021-01-09 04:06:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-09 10:06:31 +0100 |
commit | b0456669c9391423dafca39230e990ed59e112d1 (patch) | |
tree | 7ae749e00cf10d54f9c9bcd222bb76bd761ecd3f /src | |
parent | b6ac5a3ab9d2dcb9496ad16973bca14ec495fa31 (diff) | |
download | openttd-b0456669c9391423dafca39230e990ed59e112d1.tar.xz |
Fix #8506: Towns shouldn't add junctions to NewGRF roads they cannot build (#8535)
Diffstat (limited to 'src')
-rw-r--r-- | src/town_cmd.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 3a2cd7087..d92a076b2 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -1349,6 +1349,9 @@ static void GrowTownInTile(TileIndex *tile_ptr, RoadBits cur_rb, DiagDirection t assert(tile < MapSize()); + /* Don't allow junctions on roadtypes which can't be built by towns. */ + if (IsTileType(tile, MP_ROAD) && !HasBit(GetRoadTypeInfo(GetRoadTypeRoad(tile))->flags, ROTF_TOWN_BUILD)) return; + if (cur_rb == ROAD_NONE) { /* Tile has no road. First reset the status counter * to say that this is the last iteration. */ |