summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/clear_map.h6
-rw-r--r--src/tree_cmd.cpp11
2 files changed, 10 insertions, 7 deletions
diff --git a/src/clear_map.h b/src/clear_map.h
index 0177e5f7f..f5c9271d2 100644
--- a/src/clear_map.h
+++ b/src/clear_map.h
@@ -310,14 +310,14 @@ static inline void MakeField(TileIndex t, uint field_type, IndustryID industry)
* @param t the tile to make snowy
* @pre GetClearGround(t) != CLEAR_SNOW
*/
-static inline void MakeSnow(TileIndex t)
+static inline void MakeSnow(TileIndex t, uint density = 0)
{
assert(GetClearGround(t) != CLEAR_SNOW);
SetBit(_m[t].m3, 4);
if (GetClearGround(t) == CLEAR_FIELDS) {
- SetClearGroundDensity(t, CLEAR_GRASS, 0);
+ SetClearGroundDensity(t, CLEAR_GRASS, density);
} else {
- SetClearDensity(t, 0);
+ SetClearDensity(t, density);
}
}
diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp
index f0f149db7..2d0d5582d 100644
--- a/src/tree_cmd.cpp
+++ b/src/tree_cmd.cpp
@@ -702,16 +702,19 @@ static void TileLoop_Trees(TileIndex tile)
case TREE_GROUND_SHORE: MakeShore(tile); break;
case TREE_GROUND_GRASS: MakeClear(tile, CLEAR_GRASS, GetTreeDensity(tile)); break;
case TREE_GROUND_ROUGH: MakeClear(tile, CLEAR_ROUGH, 3); break;
- case TREE_GROUND_ROUGH_SNOW:
+ case TREE_GROUND_ROUGH_SNOW: {
+ uint density = GetTreeDensity(tile);
MakeClear(tile, CLEAR_ROUGH, 3);
- MakeSnow(tile);
+ MakeSnow(tile, density);
break;
+ }
default: // snow or desert
if (_settings_game.game_creation.landscape == LT_TROPIC) {
MakeClear(tile, CLEAR_DESERT, GetTreeDensity(tile));
} else {
- MakeClear(tile, CLEAR_GRASS, GetTreeDensity(tile));
- MakeSnow(tile);
+ uint density = GetTreeDensity(tile);
+ MakeClear(tile, CLEAR_GRASS, 3);
+ MakeSnow(tile, density);
}
break;
}