(svn r20668) -Codechange: add (more) support for bridges over objects

This commit is contained in:
rubidium
2010-08-28 19:02:21 +00:00
parent 3e67b4fe5f
commit 41a80490be
3 changed files with 16 additions and 4 deletions

View File

@@ -667,11 +667,12 @@ CommandCost ClearTile_Station(TileIndex tile, DoCommandFlag flags);
* @param tile TileIndex to check.
* @param invalid_dirs Prohibited directions for slopes (set of #DiagDirection).
* @param allowed_z Height allowed for the tile. If allowed_z is negative, it will be set to the height of this tile.
* @param check_bridge Check for the existance of a bridge.
* @return The cost in case of success, or an error code if it failed.
*/
CommandCost CheckBuildableTile(TileIndex tile, uint invalid_dirs, int &allowed_z)
CommandCost CheckBuildableTile(TileIndex tile, uint invalid_dirs, int &allowed_z, bool check_bridge = true)
{
if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) {
if (check_bridge && MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) {
return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
}