forked from mirror/OpenTTD
(svn r26879) -Codechange: remove most MayHaveBridgeAbove calls since the data is now always accessible
This commit is contained in:
@@ -376,15 +376,13 @@ CommandCost CmdBuildBridge(TileIndex end_tile, DoCommandFlag flags, uint32 p1, u
|
||||
|
||||
const TileIndex heads[] = {tile_start, tile_end};
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (MayHaveBridgeAbove(heads[i])) {
|
||||
if (IsBridgeAbove(heads[i])) {
|
||||
TileIndex north_head = GetNorthernBridgeEnd(heads[i]);
|
||||
if (IsBridgeAbove(heads[i])) {
|
||||
TileIndex north_head = GetNorthernBridgeEnd(heads[i]);
|
||||
|
||||
if (direction == GetBridgeAxis(heads[i])) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
|
||||
if (direction == GetBridgeAxis(heads[i])) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
|
||||
|
||||
if (z_start + 1 == GetBridgeHeight(north_head)) {
|
||||
return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
|
||||
}
|
||||
if (z_start + 1 == GetBridgeHeight(north_head)) {
|
||||
return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -393,7 +391,7 @@ 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 (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) {
|
||||
if (IsBridgeAbove(tile)) {
|
||||
/* Disallow crossing bridges for the time being */
|
||||
return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
|
||||
}
|
||||
|
Reference in New Issue
Block a user