Add setting to allow placing stations under bridges

This commit is contained in:
Jonathan G Rennison
2018-07-24 03:07:24 +01:00
parent 56bde8ce18
commit 4bdbf3863d
7 changed files with 26 additions and 5 deletions

View File

@@ -733,7 +733,7 @@ CommandCost ClearTile_Station(TileIndex tile, DoCommandFlag flags);
*/
CommandCost CheckBuildableTile(TileIndex tile, uint invalid_dirs, int &allowed_z, bool allow_steep, bool check_bridge = true)
{
if (check_bridge && IsBridgeAbove(tile)) {
if (check_bridge && IsBridgeAbove(tile) && !_settings_game.construction.allow_stations_under_bridges) {
return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
}
@@ -2619,7 +2619,7 @@ CommandCost CmdBuildDock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
CommandCost ret = CheckIfAuthorityAllowsNewStation(slope_tile, flags);
if (ret.Failed()) return ret;
if (IsBridgeAbove(slope_tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
if (IsBridgeAbove(slope_tile) && !_settings_game.construction.allow_stations_under_bridges) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
ret = DoCommand(slope_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
if (ret.Failed()) return ret;
@@ -2628,7 +2628,7 @@ CommandCost CmdBuildDock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
}
if (IsBridgeAbove(flat_tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
if (IsBridgeAbove(flat_tile) && !_settings_game.construction.allow_stations_under_bridges) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
/* Get the water class of the water tile before it is cleared.*/
WaterClass wc = GetWaterClass(flat_tile);
@@ -3080,6 +3080,7 @@ draw_default_foundation:
}
DrawRailTileSeq(ti, t, TO_BUILDINGS, total_offset, relocation, palette);
DrawBridgeMiddle(ti);
}
void StationPickerDrawSprite(int x, int y, StationType st, RailType railtype, RoadType roadtype, int image)