@@ -189,28 +189,30 @@ CommandCost CmdRemoveRoad(TileIndex tile
/* limit the bits to delete to the existing bits. */
c &= present;
if (c == ROAD_NONE) return CMD_ERROR;
if (flags & DC_EXEC) {
ChangeTownRating(t, -road_remove_cost[(byte)edge_road], RATING_ROAD_MINIMUM);
present ^= c;
if (present == ROAD_NONE) {
RoadTypes rts = GetRoadTypes(tile) & ComplementRoadTypes(RoadTypeToRoadTypes(rt));
if (rts == ROADTYPES_NONE) {
/* Includes MarkTileDirtyByTile() */
DoClearSquare(tile);
} else {
SetRoadBits(tile, ROAD_NONE, rt);
SetRoadTypes(tile, rts);
MarkTileDirtyByTile(tile);
}
/* When bits are removed, you *always* end up with something that
* is not a complete straight road tile. However, trams do not have
* onewayness, so they cannot remove it either. */
if (rt != ROADTYPE_TRAM) SetDisallowedRoadDirections(tile, DRD_NONE);
SetRoadBits(tile, present, rt);
return CommandCost(COUNTBITS(c) * _price.remove_road);