From 51e22617cd2f05166252acdb0ea4bd45ede2a0f3 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 21 Apr 2021 21:42:52 +0100 Subject: [PATCH] Disallow converting town-owned roads to types with the no houses flag --- src/road_cmd.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index b84365b8fd..174f37d72d 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -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) {