mirror of https://github.com/OpenTTD/OpenTTD.git
Feature: Setting to disallow level crossings with competitors (#10755)
This commit is contained in:
parent
236ec41fa2
commit
a5c8365aa4
|
@ -1426,6 +1426,9 @@ STR_CONFIG_SETTING_PLANE_CRASHES_NONE :None*
|
||||||
STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Reduced
|
STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Reduced
|
||||||
STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal
|
STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Normal
|
||||||
|
|
||||||
|
STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR :Allow level crossings with roads or rails owned by competitors: {STRING2}
|
||||||
|
STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT :Allow construction of level crossings on roads or rails owned by competitors
|
||||||
|
|
||||||
STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Allow drive-through road stops on roads owned by towns: {STRING2}
|
STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Allow drive-through road stops on roads owned by towns: {STRING2}
|
||||||
STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Allow construction of drive-through road stops on roads owned by towns
|
STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD_HELPTEXT :Allow construction of drive-through road stops on roads owned by towns
|
||||||
STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Allow drive-through road stops on roads owned by competitors: {STRING2}
|
STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :Allow drive-through road stops on roads owned by competitors: {STRING2}
|
||||||
|
|
|
@ -507,6 +507,11 @@ CommandCost CmdBuildSingleRail(DoCommandFlag flags, TileIndex tile, RailType rai
|
||||||
/* Level crossings may only be built on these slopes */
|
/* Level crossings may only be built on these slopes */
|
||||||
if (!HasBit(VALID_LEVEL_CROSSING_SLOPES, tileh)) return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
|
if (!HasBit(VALID_LEVEL_CROSSING_SLOPES, tileh)) return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
|
||||||
|
|
||||||
|
if (!_settings_game.construction.crossing_with_competitor && _current_company != OWNER_DEITY) {
|
||||||
|
CommandCost ret = CheckTileOwnership(tile);
|
||||||
|
if (ret.Failed()) return ret;
|
||||||
|
}
|
||||||
|
|
||||||
CommandCost ret = EnsureNoVehicleOnGround(tile);
|
CommandCost ret = EnsureNoVehicleOnGround(tile);
|
||||||
if (ret.Failed()) return ret;
|
if (ret.Failed()) return ret;
|
||||||
|
|
||||||
|
|
|
@ -737,6 +737,11 @@ CommandCost CmdBuildRoad(DoCommandFlag flags, TileIndex tile, RoadBits pieces, R
|
||||||
return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
|
return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!_settings_game.construction.crossing_with_competitor && company != OWNER_TOWN && company != OWNER_DEITY) {
|
||||||
|
CommandCost ret = CheckTileOwnership(tile);
|
||||||
|
if (ret.Failed()) return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if (GetRailTileType(tile) != RAIL_TILE_NORMAL) goto do_clear;
|
if (GetRailTileType(tile) != RAIL_TILE_NORMAL) goto do_clear;
|
||||||
|
|
||||||
if (RoadNoLevelCrossing(rt)) {
|
if (RoadNoLevelCrossing(rt)) {
|
||||||
|
|
|
@ -1932,6 +1932,7 @@ static SettingsContainer &GetSettingsTree()
|
||||||
limitations->Add(new SettingEntry("station.distant_join_stations"));
|
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_town_road"));
|
||||||
limitations->Add(new SettingEntry("construction.road_stop_on_competitor_road"));
|
limitations->Add(new SettingEntry("construction.road_stop_on_competitor_road"));
|
||||||
|
limitations->Add(new SettingEntry("construction.crossing_with_competitor"));
|
||||||
limitations->Add(new SettingEntry("vehicle.disable_elrails"));
|
limitations->Add(new SettingEntry("vehicle.disable_elrails"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -368,6 +368,7 @@ struct ConstructionSettings {
|
||||||
bool extra_dynamite; ///< extra dynamite
|
bool extra_dynamite; ///< extra dynamite
|
||||||
bool road_stop_on_town_road; ///< allow building of drive-through road stops on town owned roads
|
bool road_stop_on_town_road; ///< allow building of drive-through road stops on town owned roads
|
||||||
bool road_stop_on_competitor_road; ///< allow building of drive-through road stops on roads owned by competitors
|
bool road_stop_on_competitor_road; ///< allow building of drive-through road stops on roads owned by competitors
|
||||||
|
bool crossing_with_competitor; ///< allow building of level crossings with competitor roads or rails
|
||||||
uint8_t raw_industry_construction; ///< type of (raw) industry construction (none, "normal", prospecting)
|
uint8_t raw_industry_construction; ///< type of (raw) industry construction (none, "normal", prospecting)
|
||||||
uint8_t industry_platform; ///< the amount of flat land around an industry
|
uint8_t industry_platform; ///< the amount of flat land around an industry
|
||||||
bool freeform_edges; ///< allow terraforming the tiles at the map edges
|
bool freeform_edges; ///< allow terraforming the tiles at the map edges
|
||||||
|
|
|
@ -523,6 +523,13 @@ str = STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD
|
||||||
strhelp = STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD_HELPTEXT
|
strhelp = STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD_HELPTEXT
|
||||||
cat = SC_BASIC
|
cat = SC_BASIC
|
||||||
|
|
||||||
|
[SDT_BOOL]
|
||||||
|
var = construction.crossing_with_competitor
|
||||||
|
def = true
|
||||||
|
str = STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR
|
||||||
|
strhelp = STR_CONFIG_SETTING_CROSSING_WITH_COMPETITOR_HELPTEXT
|
||||||
|
cat = SC_BASIC
|
||||||
|
|
||||||
[SDT_VAR]
|
[SDT_VAR]
|
||||||
var = construction.raw_industry_construction
|
var = construction.raw_industry_construction
|
||||||
type = SLE_UINT8
|
type = SLE_UINT8
|
||||||
|
|
Loading…
Reference in New Issue