Fix #8506: Towns shouldn't add junctions to NewGRF roads they cannot build (#8535)

This commit is contained in:
Tyler Trahan 2021-01-09 04:06:31 -05:00 committed by GitHub
parent b6ac5a3ab9
commit b0456669c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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. */