Feature: Setting to disallow level crossings with competitors (#10755)

This commit is contained in:
mrmbernardi
2023-09-02 12:46:24 +02:00
committed by GitHub
parent 236ec41fa2
commit a5c8365aa4
6 changed files with 22 additions and 0 deletions

View File

@@ -737,6 +737,11 @@ CommandCost CmdBuildRoad(DoCommandFlag flags, TileIndex tile, RoadBits pieces, R
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 (RoadNoLevelCrossing(rt)) {