Add setting to allow placing all NewGRF objects under bridges

This commit is contained in:
Jonathan G Rennison
2018-07-24 03:02:18 +01:00
parent 035c00b521
commit 56bde8ce18
6 changed files with 22 additions and 5 deletions

View File

@@ -294,11 +294,13 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
if (cost.Failed()) return cost;
/* Finally do a check for bridges. */
TILE_AREA_LOOP(t, ta) {
if (IsBridgeAbove(t) && (
!(spec->flags & OBJECT_FLAG_ALLOW_UNDER_BRIDGE) ||
(GetTileMaxZ(t) + spec->height >= GetBridgeHeight(GetSouthernBridgeEnd(t))))) {
return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
if (type < NEW_OBJECT_OFFSET || !_settings_game.construction.allow_grf_objects_under_bridges) {
TILE_AREA_LOOP(t, ta) {
if (IsBridgeAbove(t) && (
!(spec->flags & OBJECT_FLAG_ALLOW_UNDER_BRIDGE) ||
(GetTileMaxZ(t) + spec->height >= GetBridgeHeight(GetSouthernBridgeEnd(t))))) {
return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
}
}
}