diff options
-rw-r--r-- | clear_cmd.c | 7 | ||||
-rw-r--r-- | tree_cmd.c | 6 |
2 files changed, 6 insertions, 7 deletions
diff --git a/clear_cmd.c b/clear_cmd.c index 7cb068b6c..1f46a071d 100644 --- a/clear_cmd.c +++ b/clear_cmd.c @@ -595,17 +595,16 @@ void TileLoopClearHelper(TileIndex tile) /* convert into snowy tiles */ static void TileLoopClearAlps(TileIndex tile) { - /* distance from snow line, in steps of 8 */ - int k = GetTileZ(tile) - _opt.snow_line; + int k = GetTileZ(tile) - _opt.snow_line + TILE_HEIGHT; - if (k < -TILE_HEIGHT) { // well below the snow line + if (k < 0) { // well below the snow line if (!IsClearGround(tile, CLEAR_SNOW)) return; if (GetClearDensity(tile) == 0) SetClearGroundDensity(tile, CLEAR_GRASS, 3); } else { if (!IsClearGround(tile, CLEAR_SNOW)) { SetClearGroundDensity(tile, CLEAR_SNOW, 0); } else { - uint density = min((uint)(k + TILE_HEIGHT) / TILE_HEIGHT, 3); + uint density = min((uint)k / TILE_HEIGHT, 3); if (GetClearDensity(tile) < density) { AddClearDensity(tile, 1); 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) { |