summaryrefslogtreecommitdiff
path: root/clear_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
commitc51d0c0a0904716f480829e2d2125d05bde7f0b3 (patch)
tree93f255ec86125d966e4fd68b07e20dfec7484833 /clear_cmd.c
parentfe2faf54574dc60e6331509613bcff47e56fe645 (diff)
downloadopenttd-c51d0c0a0904716f480829e2d2125d05bde7f0b3.tar.xz
(svn r5581) Slightly alter some snow line related calculations to make them a bit clearer
Diffstat (limited to 'clear_cmd.c')
-rw-r--r--clear_cmd.c7
1 files changed, 3 insertions, 4 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);