summaryrefslogtreecommitdiff
path: root/tree_cmd.c
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
commita538fb3213c73aae254df4452a973949dc722a87 (patch)
tree12b12a93c01ace07fc9ccaab9dac9bfe1259843b /tree_cmd.c
parente4f558de8c167d87530c14a7918d36cbcf514196 (diff)
downloadopenttd-a538fb3213c73aae254df4452a973949dc722a87.tar.xz
(svn r1299) -Fix: [ 1092473 ] In SE, when trees are placed randomly, they are no
longer placed on farmland
Diffstat (limited to 'tree_cmd.c')
-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);