Disallow converting town-owned roads to types with the no houses flag

pull/251/head
Jonathan G Rennison 3 years ago
parent e81ba600ba
commit 51e22617cd

@ -2966,6 +2966,13 @@ 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)) {
error.MakeError(STR_ERROR_OWNED_BY);
GetNameOfOwner(OWNER_TOWN, tile);
continue;
}
/* Vehicle on the tile when not converting normal <-> powered
* Tunnels and bridges have special check later */
if (tt != MP_TUNNELBRIDGE) {

Loading…
Cancel
Save