From cc87f682b9cd9c25ee58cec1b63792e4ef786aa9 Mon Sep 17 00:00:00 2001 From: celestar Date: Mon, 3 Apr 2006 09:07:21 +0000 Subject: (svn r4249) -Codechange: Replace more occurences of 16 by TILE_SIZE and of 8 by TILE_HEIGHT. Reverted one change from the previous commit because it was faulty --- tree_cmd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tree_cmd.c') diff --git a/tree_cmd.c b/tree_cmd.c index eb87d7766..aeaf4d988 100644 --- a/tree_cmd.c +++ b/tree_cmd.c @@ -143,7 +143,8 @@ int32 CmdPlantTree(int ex, int ey, uint32 flags, uint32 p1, uint32 p2) // make sure sx,sy are smaller than ex,ey sx = TileX(p2); sy = TileY(p2); - ex /= 16; ey /= 16; + ex /= TILE_SIZE; + ey /= TILE_SIZE; if (ex < sx) intswap(ex, sx); if (ey < sy) intswap(ey, sy); @@ -405,11 +406,11 @@ static void TileLoopTreesAlps(TileIndex tile) { int k = GetTileZ(tile) - _opt.snow_line; - if (k < -8) { + if (k < -TILE_HEIGHT) { if (GetTreeGround(tile) != TR_SNOW_DESERT) return; SetTreeGroundDensity(tile, TR_GRASS, 0); } else { - uint density = min((uint)(k + 8) / 8, 3); + uint density = min((uint)(k + TILE_HEIGHT) / TILE_HEIGHT, 3); if (GetTreeGround(tile) != TR_SNOW_DESERT || GetTreeDensity(tile) != density) { SetTreeGroundDensity(tile, TR_SNOW_DESERT, density); -- cgit v1.2.3-54-g00ecf