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

@@ -493,6 +493,7 @@ CommandCost CmdBuildBridge(TileIndex end_tile, DoCommandFlag flags, uint32 p1, u
break;
case MP_OBJECT: {
if (_settings_game.construction.allow_grf_objects_under_bridges && GetObjectType(tile) >= NEW_OBJECT_OFFSET) break;
const ObjectSpec *spec = ObjectSpec::GetByTile(tile);
if ((spec->flags & OBJECT_FLAG_ALLOW_UNDER_BRIDGE) == 0) goto not_valid_below;
if (GetTileMaxZ(tile) + spec->height > z_start) goto not_valid_below;