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

See: 51e22617
pull/590/head
Jonathan G Rennison 10 months ago
parent ff61b6d243
commit b0538a00e0

@ -706,6 +706,9 @@ STR_CONFIG_SETTING_NO_EXPIRE_OBJECTS_AFTER_ZERO :Off
STR_CONFIG_SETTING_IGNORE_OBJECT_INTRO_DATES :Ignore object introduction dates: {STRING2}
STR_CONFIG_SETTING_IGNORE_OBJECT_INTRO_DATES_HELPTEXT :Set whether players are allowed to build objects before their introduction date.{}Does not apply to objects constructed during map generation.
STR_CONFIG_SETTING_ALLOW_CONVERT_TOWN_ROAD_NO_HOUSES :Allow converting town roads to non-house types: {STRING2}
STR_CONFIG_SETTING_ALLOW_CONVERT_TOWN_ROAD_NO_HOUSES_HELPTEXT :Whether to allow players to convert town-owned roads to a road type which does not allow houses.{}This is off by default because doing so can prevent towns from building houses at all, resulting in them shrinking.
STR_PURCHASE_LAND_PERMITTED_NO :No
STR_PURCHASE_LAND_PERMITTED_SINGLE :Yes, 1 tile at a time
STR_PURCHASE_LAND_PERMITTED_AREA :Yes, large areas at a time

@ -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;

@ -2296,6 +2296,7 @@ static SettingsContainer &GetSettingsTree()
limitations->Add(new SettingEntry("station.distant_join_stations"));
limitations->Add(new SettingEntry("construction.road_stop_on_town_road"));
limitations->Add(new SettingEntry("construction.road_stop_on_competitor_road"));
limitations->Add(new SettingEntry("construction.convert_town_road_no_houses"));
limitations->Add(new SettingEntry("vehicle.disable_elrails"));
limitations->Add(new SettingEntry("construction.maximum_signal_evaluations"));
limitations->Add(new SettingEntry("construction.enable_build_river"));

@ -496,6 +496,7 @@ struct ConstructionSettings {
bool build_object_area_permitted; ///< whether building objects by area is permitted
Year no_expire_objects_after; ///< do not expire objects after this year
bool ignore_object_intro_dates; ///< allow players to build objects before their introduction dates (does not include during map generation)
bool convert_town_road_no_houses; ///< allow converting town roads to a type which does not allow houses
uint32 terraform_per_64k_frames; ///< how many tile heights may, over a long period, be terraformed per 65536 frames?
uint16 terraform_frame_burst; ///< how many tile heights may, over a short period, be terraformed?

@ -2221,6 +2221,14 @@ strhelp = STR_CONFIG_SETTING_IGNORE_OBJECT_INTRO_DATES_HELPTEXT
patxname = ""construction.ignore_object_intro_dates""
post_cb = [](auto) { InvalidateWindowClassesData(WC_BUILD_OBJECT, 0); }
[SDT_BOOL]
var = construction.convert_town_road_no_houses
def = false
str = STR_CONFIG_SETTING_ALLOW_CONVERT_TOWN_ROAD_NO_HOUSES
strhelp = STR_CONFIG_SETTING_ALLOW_CONVERT_TOWN_ROAD_NO_HOUSES_HELPTEXT
cat = SC_EXPERT
patxname = ""construction.convert_town_road_no_houses""
[SDT_BOOL]
var = station.adjacent_stations
from = SLV_62

Loading…
Cancel
Save