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

This commit is contained in:
Jonathan G Rennison
2021-04-21 21:42:52 +01:00
parent e81ba600ba
commit 51e22617cd

View File

@@ -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) {