(svn r5966) -Fix: prevent that the industry placement's terraforming checks can leave the map on the southern side
authorrubidium
Sun, 20 Aug 2006 10:45:36 +0000
changeset 4313 fc428e434474
parent 4312 9ac0363f38f5
child 4314 5c816195d9d4
(svn r5966) -Fix: prevent that the industry placement's terraforming checks can leave the map on the southern side
industry_cmd.c
--- a/industry_cmd.c	Sun Aug 20 09:52:15 2006 +0000
+++ b/industry_cmd.c	Sun Aug 20 10:45:36 2006 +0000
@@ -1317,7 +1317,7 @@
 	size_y = max_y + 4;
 
 	/* Check if we don't leave the map */
-	if (TileX(cur_tile) == 0 || TileY(cur_tile) == 0 || GetTileType(cur_tile) == MP_VOID) return false;
+	if (TileX(cur_tile) == 0 || TileY(cur_tile) == 0 || TileX(cur_tile) + size_x >= MapMaxX() || TileY(cur_tile) + size_y >= MapMaxY()) return false;
 
 	BEGIN_TILE_LOOP(tile_walk, size_x, size_y, cur_tile) {
 		curh = TileHeight(tile_walk);