clear_cmd.c
changeset 2934 3b7eef9871f8
parent 2705 a0aed2277d0c
child 2951 2db3adee7736
child 9942 56446313309e
--- a/clear_cmd.c	Mon Jan 30 16:58:05 2006 +0000
+++ b/clear_cmd.c	Mon Jan 30 17:18:45 2006 +0000
@@ -233,7 +233,7 @@
 	tile = TileVirtXY(x, y);
 
 	/* Make an extra check for map-bounds cause we add tiles to the originating tile */
-	if (tile + TileDiffXY(1, 1) > MapSize()) return CMD_ERROR;
+	if (tile + TileDiffXY(1, 1) >= MapSize()) return CMD_ERROR;
 
 	if (p1 & 1) {
 		if (!TerraformTileHeight(&ts, tile + TileDiffXY(1, 0),
@@ -332,7 +332,7 @@
 	TileIndex tile;
 	int32 ret, cost, money;
 
-	if (p1 > MapSize()) return CMD_ERROR;
+	if (p1 >= MapSize()) return CMD_ERROR;
 
 	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);