town_cmd.c
changeset 3933 a5f08e17f4a0
parent 3877 53efa8118448
child 3977 edb5b94e2094
--- a/town_cmd.c	Thu Jun 01 22:20:40 2006 +0000
+++ b/town_cmd.c	Fri Jun 02 13:05:41 2006 +0000
@@ -26,6 +26,7 @@
 #include "water_map.h"
 #include "variables.h"
 #include "bridge.h"
+#include "bridge_map.h"
 #include "table/town_land.h"
 
 enum {
@@ -1093,6 +1094,8 @@
 	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;
@@ -1136,6 +1139,8 @@
 
 		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;
 	}
@@ -1270,6 +1275,7 @@
 	// 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;