summaryrefslogtreecommitdiff
path: root/src/clear_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/clear_cmd.cpp')
-rw-r--r--src/clear_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/clear_cmd.cpp b/src/clear_cmd.cpp
index 3506ddbff..5f0b32aed 100644
--- a/src/clear_cmd.cpp
+++ b/src/clear_cmd.cpp
@@ -158,7 +158,7 @@ void TileLoopClearHelper(TileIndex tile)
/** Convert to or from snowy tiles. */
static void TileLoopClearAlps(TileIndex tile)
{
- int k = GetTilePixelZ(tile) - GetSnowLine() + TILE_HEIGHT;
+ int k = GetTileZ(tile) - GetSnowLine() + 1;
if (k < 0) {
/* Below the snow line, do nothing if no snow. */
@@ -173,7 +173,7 @@ static void TileLoopClearAlps(TileIndex tile)
}
/* Update snow density. */
uint curent_density = GetClearDensity(tile);
- uint req_density = (k < 0) ? 0u : min((uint)k / TILE_HEIGHT, 3);
+ uint req_density = (k < 0) ? 0u : min((uint)k, 3);
if (curent_density < req_density) {
AddClearDensity(tile, 1);