summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-12-30 09:43:12 +0000
committertruelight <truelight@openttd.org>2004-12-30 09:43:12 +0000
commit635b854c29c79dd8f22de9edb20d75207b4eafdd (patch)
tree12b12a93c01ace07fc9ccaab9dac9bfe1259843b
parentbcc3b1cbb5c8de74b46b144bb1163fe5e08eb269 (diff)
downloadopenttd-635b854c29c79dd8f22de9edb20d75207b4eafdd.tar.xz
(svn r1299) -Fix: [ 1092473 ] In SE, when trees are placed randomly, they are no
longer placed on farmland
-rw-r--r--tree_cmd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tree_cmd.c b/tree_cmd.c
index 8e1b334cf..79ebbed47 100644
--- a/tree_cmd.c
+++ b/tree_cmd.c
@@ -77,9 +77,11 @@ static void DoPlaceMoreTrees(uint tile)
dist = myabs(x) + myabs(y);
- cur_tile=TILE_MASK(tile + TILE_XY(x,y));
+ cur_tile = TILE_MASK(tile + TILE_XY(x,y));
- if (dist <= 13 && IS_TILETYPE(cur_tile, MP_CLEAR)) {
+ /* 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) {
PlaceTree(cur_tile, r, dist <= 6 ? 0xC0 : 0);
}
} while (--i);
@@ -103,7 +105,8 @@ void PlaceTreesRandomly()
do {
r = Random();
tile = TILE_MASK(r);
- if (IS_TILETYPE(tile, MP_CLEAR)) {
+ /* Only on clear tiles, and NOT on farm-tiles */
+ if (IS_TILETYPE(tile, MP_CLEAR) && (_map5[tile] & 0x1F) != 0x0F) {
PlaceTree(tile, r, 0);
}
} while (--i);