summaryrefslogtreecommitdiff
path: root/tree_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-16 11:24:58 +0000
committertron <tron@openttd.org>2005-01-16 11:24:58 +0000
commit61a6bc544d9e656feb4458b6f9a86f7b7e01e7d6 (patch)
treebc9e7bccf2119556badf2efe43aca901dfc0a76e /tree_cmd.c
parent0c587b1a6098ba546d6e05930ba54b05ec930dd4 (diff)
downloadopenttd-61a6bc544d9e656feb4458b6f9a86f7b7e01e7d6.tar.xz
(svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
Diffstat (limited to 'tree_cmd.c')
-rw-r--r--tree_cmd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tree_cmd.c b/tree_cmd.c
index 47f9792db..825166db7 100644
--- a/tree_cmd.c
+++ b/tree_cmd.c
@@ -81,7 +81,7 @@ static void DoPlaceMoreTrees(uint tile)
/* Only on tiles within 13 squares from tile,
on clear tiles, and NOT on farm-tiles or rocks */
- if (dist <= 13 && IS_TILETYPE(cur_tile, MP_CLEAR) &&
+ if (dist <= 13 && IsTileType(cur_tile, MP_CLEAR) &&
(_map5[cur_tile] & 0x1F) != 0x0F && (_map5[cur_tile] & 0x1C) != 8) {
PlaceTree(cur_tile, r, dist <= 6 ? 0xC0 : 0);
}
@@ -107,7 +107,7 @@ void PlaceTreesRandomly()
r = Random();
tile = TILE_MASK(r);
/* 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) {
+ if (IsTileType(tile, MP_CLEAR) && (_map5[tile] & 0x1F) != 0x0F && (_map5[tile] & 0x1C) != 8) {
PlaceTree(tile, r, 0);
}
} while (--i);
@@ -119,7 +119,7 @@ void PlaceTreesRandomly()
do {
r = Random();
tile = TILE_MASK(r);
- if (IS_TILETYPE(tile, MP_CLEAR) && GetMapExtraBits(tile) == 2) {
+ if (IsTileType(tile, MP_CLEAR) && GetMapExtraBits(tile) == 2) {
PlaceTree(tile, r, 0);
}
} while (--i);
@@ -516,7 +516,7 @@ static void TileLoop_Trees(uint tile)
tile += ToTileIndexDiff(_tileloop_trees_dir[Random() & 7]);
- if (!IS_TILETYPE(tile, MP_CLEAR))
+ if (!IsTileType(tile, MP_CLEAR))
return;
if ( (_map5[tile] & 0x1C) == 4) {
@@ -579,7 +579,7 @@ void OnTick_Trees()
/* place a tree at a random rainforest spot */
if (_opt.landscape == LT_DESERT &&
(r=Random(),tile=TILE_MASK(r),GetMapExtraBits(tile)==2) &&
- IS_TILETYPE(tile, MP_CLEAR) &&
+ IsTileType(tile, MP_CLEAR) &&
(m=_map5[tile]&0x1C, m<=4) &&
(tree=GetRandomTreeType(tile, r>>24)) >= 0) {
@@ -600,7 +600,7 @@ void OnTick_Trees()
/* place a tree at a random spot */
r = Random();
tile = TILE_MASK(r);
- if (IS_TILETYPE(tile, MP_CLEAR) &&
+ if (IsTileType(tile, MP_CLEAR) &&
(m=_map5[tile]&0x1C, m==0 || m==4 || m==0x10) &&
(tree=GetRandomTreeType(tile, r>>24)) >= 0) {
int m2;