Set minimum bridge height clearances for default stations

pull/73/head
Jonathan G Rennison 6 years ago
parent 2c88645bac
commit beaddc8a98

@ -782,6 +782,10 @@ bool IsRailStationBridgeAboveOk(TileIndex tile, const StationSpec *statspec, byt
if (statspec && HasBit(statspec->internal_flags, SSIF_BRIDGE_HEIGHTS_SET)) {
return (GetTileMaxZ(tile) + statspec->bridge_height[layout] <= GetBridgeHeight(GetSouthernBridgeEnd(tile)));
} else if (!statspec) {
// default stations/waypoints
const int height = layout < 4 ? 2 : 5;
return (GetTileMaxZ(tile) + height <= GetBridgeHeight(GetSouthernBridgeEnd(tile)));
} else {
return _settings_game.construction.allow_stations_under_bridges;
}

@ -502,6 +502,10 @@ CommandCost CmdBuildBridge(TileIndex end_tile, DoCommandFlag flags, uint32 p1, u
uint layout = GetStationGfx (tile);
assert(layout < 8);
if (GetTileMaxZ(tile) + statspec->bridge_height[layout] > z_start + 1) goto not_valid_below;
} else if (!statspec) {
// default stations/waypoints
const int height = GetStationGfx(tile) < 4 ? 2 : 5;
if (GetTileMaxZ(tile) + height > z_start + 1) goto not_valid_below;
} else if (!_settings_game.construction.allow_stations_under_bridges) {
goto not_valid_below;
}

Loading…
Cancel
Save