summaryrefslogtreecommitdiff
path: root/tree_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-07-22 07:36:01 +0000
committertron <tron@openttd.org>2006-07-22 07:36:01 +0000
commit475f2767691da03e22cdcd6eb7bfd305c093166c (patch)
tree93f255ec86125d966e4fd68b07e20dfec7484833 /tree_cmd.c
parentaf7fa1df24de5e473ad00fb35ceba3c36a1ab6ae (diff)
downloadopenttd-475f2767691da03e22cdcd6eb7bfd305c093166c.tar.xz
(svn r5581) Slightly alter some snow line related calculations to make them a bit clearer
Diffstat (limited to 'tree_cmd.c')
-rw-r--r--tree_cmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tree_cmd.c b/tree_cmd.c
index 808243b14..9caf6b9d6 100644
--- a/tree_cmd.c
+++ b/tree_cmd.c
@@ -405,13 +405,13 @@ static void TileLoopTreesDesert(TileIndex tile)
static void TileLoopTreesAlps(TileIndex tile)
{
- int k = GetTileZ(tile) - _opt.snow_line;
+ int k = GetTileZ(tile) - _opt.snow_line + TILE_HEIGHT;
- if (k < -TILE_HEIGHT) {
+ if (k < 0) {
if (GetTreeGround(tile) != TREE_GROUND_SNOW_DESERT) return;
SetTreeGroundDensity(tile, TREE_GROUND_GRASS, 0);
} else {
- uint density = min((uint)(k + TILE_HEIGHT) / TILE_HEIGHT, 3);
+ uint density = min((uint)k / TILE_HEIGHT, 3);
if (GetTreeGround(tile) != TREE_GROUND_SNOW_DESERT ||
GetTreeDensity(tile) != density) {