summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2005-01-03 21:47:52 +0000
committerdarkvater <darkvater@openttd.org>2005-01-03 21:47:52 +0000
commit9a49fda8e632756adff78f9ead654becd7276bef (patch)
tree8bde9303972ab3b055bf8c5a6ceaa5bcdd8530b2
parentd922ca68e77e175d1a860f1670cfd41d04897eeb (diff)
downloadopenttd-9a49fda8e632756adff78f9ead654becd7276bef.tar.xz
(svn r1355) -Fix: [1092473] random trees in scenario editor do not overwrite rocks as well
-rw-r--r--tree_cmd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tree_cmd.c b/tree_cmd.c
index 3aa315056..0aeea1a3e 100644
--- a/tree_cmd.c
+++ b/tree_cmd.c
@@ -80,8 +80,9 @@ static void DoPlaceMoreTrees(uint tile)
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 @@ void PlaceTreesRandomly()
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);