(svn r1355) -Fix: [1092473] random trees in scenario editor do not overwrite rocks as well
authordarkvater
Mon, 03 Jan 2005 21:47:52 +0000
changeset 874 877069ec457f
parent 873 46e892485be3
child 875 5e2f5be507ee
(svn r1355) -Fix: [1092473] random trees in scenario editor do not overwrite rocks as well
tree_cmd.c
--- a/tree_cmd.c	Mon Jan 03 21:29:59 2005 +0000
+++ b/tree_cmd.c	Mon Jan 03 21:47:52 2005 +0000
@@ -80,8 +80,9 @@
 		cur_tile = TILE_MASK(tile + TILE_XY(x,y));
 
 		/* Only on tiles within 13 squares from tile,
-		    on clear tiles, and NOT on farm-tiles */
-		if (dist <= 13 && IS_TILETYPE(cur_tile, MP_CLEAR) && (_map5[tile] & 0x1F) != 0x0F) {
+		    on clear tiles, and NOT on farm-tiles or rocks */
+		if (dist <= 13 && IS_TILETYPE(cur_tile, MP_CLEAR) && 
+			 (_map5[cur_tile] & 0x1F) != 0x0F && (_map5[cur_tile] & 0x1C) != 8) {
 			PlaceTree(cur_tile, r, dist <= 6 ? 0xC0 : 0);
 		}
 	} while (--i);
@@ -105,8 +106,8 @@
 	do {
 		r = Random();
 		tile = TILE_MASK(r);
-		/* Only on clear tiles, and NOT on farm-tiles */
-		if (IS_TILETYPE(tile, MP_CLEAR) && (_map5[tile] & 0x1F) != 0x0F) {
+		/* Only on clear tiles, and NOT on farm-tiles or rocks */
+		if (IS_TILETYPE(tile, MP_CLEAR) && (_map5[tile] & 0x1F) != 0x0F && (_map5[tile] & 0x1C) != 8) {
 			PlaceTree(tile, r, 0);
 		}
 	} while (--i);