(svn r26882) -Feature: allow limiting the height of bridges (ic111)

This commit is contained in:
rubidium
2014-09-21 11:40:11 +00:00
parent b50c649405
commit 647a3c8e5f
5 changed files with 31 additions and 4 deletions

View File

@@ -391,6 +391,16 @@ CommandCost CmdBuildBridge(TileIndex end_tile, DoCommandFlag flags, uint32 p1, u
for (TileIndex tile = tile_start + delta; tile != tile_end; tile += delta) {
if (GetTileMaxZ(tile) > z_start) return_cmd_error(STR_ERROR_BRIDGE_TOO_LOW_FOR_TERRAIN);
if (z_start >= (GetTileZ(tile) + _settings_game.construction.max_bridge_height)) {
/*
* Disallow too high bridges.
* Properly rendering a map where very high bridges (might) exist is expensive.
* See http://www.tt-forums.net/viewtopic.php?f=33&t=40844&start=980#p1131762
* for a detailed discussion. z_start here is one heightlevel below the bridge level.
*/
return_cmd_error(STR_ERROR_BRIDGE_TOO_HIGH_FOR_TERRAIN);
}
if (IsBridgeAbove(tile)) {
/* Disallow crossing bridges for the time being */
return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);