water_cmd.c
branch0.5
changeset 5541 08e4afe5e927
parent 5536 11b3dd55f6f4
--- a/water_cmd.c	Sun Sep 09 16:59:56 2007 +0000
+++ b/water_cmd.c	Sun Sep 09 20:36:15 2007 +0000
@@ -61,10 +61,7 @@
 
 	if (p1 > 1) return CMD_ERROR;
 
-	if (!EnsureNoVehicle(tile)) return CMD_ERROR;
-
 	tile2 = tile + (p1 ? TileDiffXY(0, 1) : TileDiffXY(1, 0));
-	if (!EnsureNoVehicle(tile2)) return CMD_ERROR;
 
 	if (!IsClearWaterTile(tile) || !IsClearWaterTile(tile2))
 		return_cmd_error(STR_3801_MUST_BE_BUILT_ON_WATER);
@@ -294,15 +291,15 @@
 		case WATER_CLEAR:
 			if (flags & DC_NO_WATER) return_cmd_error(STR_3807_CAN_T_BUILD_ON_WATER);
 
-			// Make sure no vehicle is on the tile
-			if (!EnsureNoVehicle(tile)) return CMD_ERROR;
-
 			// Make sure it's not an edge tile.
 			if (!IS_INT_INSIDE(TileX(tile), 1, MapMaxX() - 1) ||
 					!IS_INT_INSIDE(TileY(tile), 1, MapMaxY() - 1)) {
 				return_cmd_error(STR_0002_TOO_CLOSE_TO_EDGE_OF_MAP);
 			}
 
+			/* Make sure no vehicle is on the tile */
+			if (!EnsureNoVehicle(tile)) return CMD_ERROR;
+
 			if (GetTileOwner(tile) != OWNER_WATER && GetTileOwner(tile) != OWNER_NONE && !CheckTileOwnership(tile)) return CMD_ERROR;
 
 			if (flags & DC_EXEC) DoClearSquare(tile);
@@ -314,12 +311,6 @@
 			// Make sure no vehicle is on the tile
 			if (!EnsureNoVehicle(tile)) return CMD_ERROR;
 
-			// Make sure it's not an edge tile.
-			if (!IS_INT_INSIDE(TileX(tile), 1, MapMaxX() - 1) ||
-					!IS_INT_INSIDE(TileY(tile), 1, MapMaxY() - 1)) {
-				return_cmd_error(STR_0002_TOO_CLOSE_TO_EDGE_OF_MAP);
-			}
-
 			if (flags & DC_EXEC) DoClearSquare(tile);
 			if (slope == SLOPE_N || slope == SLOPE_E || slope == SLOPE_S || slope == SLOPE_W) {
 				return _price.clear_water;