summaryrefslogtreecommitdiff
path: root/town_cmd.c
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2006-12-27 12:38:02 +0000
committercelestar <celestar@openttd.org>2006-12-27 12:38:02 +0000
commitd95e2c2dd10a0dfc1704962a68a2bd32b635d158 (patch)
tree28100daed109de06e979123edd0601487ecc8261 /town_cmd.c
parentd92103d6ff97ae413e2e6eae602e04b05addaf17 (diff)
downloadopenttd-d95e2c2dd10a0dfc1704962a68a2bd32b635d158.tar.xz
(svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
Diffstat (limited to 'town_cmd.c')
-rw-r--r--town_cmd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/town_cmd.c b/town_cmd.c
index 923846369..bcffa01c0 100644
--- a/town_cmd.c
+++ b/town_cmd.c
@@ -26,6 +26,7 @@
#include "water_map.h"
#include "variables.h"
#include "bridge.h"
+#include "bridge_map.h"
#include "date.h"
#include "table/town_land.h"
#include "genworld.h"
@@ -1118,6 +1119,8 @@ static bool CheckBuildHouseMode(TileIndex tile, Slope tileh, int mode)
slope = GetTileSlope(tile, NULL);
if (IsSteepSlope(slope)) return false;
+ if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return false;
+
b = 0;
if ((slope != SLOPE_FLAT && ~slope & _masks[mode])) b = ~b;
if ((tileh != SLOPE_FLAT && ~tileh & _masks[mode+4])) b = ~b;
@@ -1160,6 +1163,8 @@ static bool CheckFree2x2Area(TileIndex tile)
if (GetTileSlope(tile, NULL) != SLOPE_FLAT) return false;
+ if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return false;
+
if (CmdFailed(DoCommand(tile, 0, 0, DC_EXEC | DC_AUTO | DC_NO_WATER | DC_FORCETEST, CMD_LANDSCAPE_CLEAR)))
return false;
}
@@ -1291,6 +1296,7 @@ static bool BuildTownHouse(Town *t, TileIndex tile)
// make sure it's possible
if (!EnsureNoVehicle(tile)) return false;
if (IsSteepSlope(GetTileSlope(tile, NULL))) return false;
+ if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return false;
r = DoCommand(tile, 0, 0, DC_EXEC | DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR);
if (CmdFailed(r)) return false;