summaryrefslogtreecommitdiff
path: root/src/tunnelbridge_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-09-21 11:24:51 +0000
committerrubidium <rubidium@openttd.org>2014-09-21 11:24:51 +0000
commit9daf7e749ccb00873443e2261379bf31999664d9 (patch)
treec6121f8173938736242b84b2830058d330f1da9a /src/tunnelbridge_cmd.cpp
parent982f5a6aa2f600106f9bd292ebefcef52e6e65e6 (diff)
downloadopenttd-9daf7e749ccb00873443e2261379bf31999664d9.tar.xz
(svn r26879) -Codechange: remove most MayHaveBridgeAbove calls since the data is now always accessible
Diffstat (limited to 'src/tunnelbridge_cmd.cpp')
-rw-r--r--src/tunnelbridge_cmd.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index 9bb96538d..49b987d0a 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -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);
}