Add setting for whether to allow converting town road to non-house types

See: 51e22617
This commit is contained in:
Jonathan G Rennison
2023-08-20 17:46:05 +01:00
parent ff61b6d243
commit b0538a00e0
5 changed files with 16 additions and 2 deletions

View File

@@ -3117,8 +3117,9 @@ CommandCost CmdConvertRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
}
}
/* Disallow converting town roads to types which do not allow houses */
if (rtt == RTT_ROAD && owner == OWNER_TOWN && HasBit(GetRoadTypeInfo(to_type)->flags, ROTF_NO_HOUSES)) {
/* Disallow converting town roads to types which do not allow houses, unless this is allowed */
if (rtt == RTT_ROAD && owner == OWNER_TOWN && HasBit(GetRoadTypeInfo(to_type)->flags, ROTF_NO_HOUSES)
&& !_settings_game.construction.convert_town_road_no_houses) {
error.MakeError(STR_ERROR_OWNED_BY);
GetNameOfOwner(OWNER_TOWN, tile);
continue;