summaryrefslogtreecommitdiff
path: root/src/tree_cmd.cpp
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-03-20 13:47:00 +0000
committermaedhros <maedhros@openttd.org>2007-03-20 13:47:00 +0000
commit94db6aa1a2849167ba5100a5f3d6393007ec988b (patch)
treea58aa837d70b430e5ab2ea0f71158e3b6032453b /src/tree_cmd.cpp
parentad0b5de3da0a6ca375a344e2cbd79a3bc7c4137f (diff)
downloadopenttd-94db6aa1a2849167ba5100a5f3d6393007ec988b.tar.xz
(svn r9371) -Feature: Add support for variable snow lines in the arctic climate, supplied
by newgrf files. When this is enabled forests cannot be built below the highest snow line, and farms can't be built above it. Houses still use the _opt.snow_line so they are all consistent, so to make them respect the snowline you may want to use some newhouses features as well.
Diffstat (limited to 'src/tree_cmd.cpp')
-rw-r--r--src/tree_cmd.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp
index ca1af6788..d52d0b63a 100644
--- a/src/tree_cmd.cpp
+++ b/src/tree_cmd.cpp
@@ -9,6 +9,7 @@
#include "table/tree_land.h"
#include "functions.h"
#include "map.h"
+#include "landscape.h"
#include "tile.h"
#include "tree_map.h"
#include "viewport.h"
@@ -53,7 +54,7 @@ static void PlaceTree(TileIndex tile, uint32 r)
MakeTree(tile, tree, GB(r, 22, 2), min(GB(r, 16, 3), 6), TREE_GROUND_GRASS, 0);
// above snowline?
- if (_opt.landscape == LT_HILLY && GetTileZ(tile) > _opt.snow_line) {
+ if (_opt.landscape == LT_HILLY && GetTileZ(tile) > GetSnowLine()) {
SetTreeGroundDensity(tile, TREE_GROUND_SNOW_DESERT, 3);
SetTreeCounter(tile, (TreeGround)GB(r, 24, 3));
} else {
@@ -150,7 +151,7 @@ void PlaceTreesRandomly()
j = GetTileZ(tile) / TILE_HEIGHT * 2;
while (j--) {
/* Above snowline more trees! */
- if (_opt.landscape == LT_HILLY && ht > _opt.snow_line) {
+ if (_opt.landscape == LT_HILLY && ht > GetSnowLine()) {
PlaceTreeAtSameHeight(tile, ht);
PlaceTreeAtSameHeight(tile, ht);
};
@@ -496,7 +497,7 @@ static void TileLoopTreesDesert(TileIndex tile)
static void TileLoopTreesAlps(TileIndex tile)
{
- int k = GetTileZ(tile) - _opt.snow_line + TILE_HEIGHT;
+ int k = GetTileZ(tile) - GetSnowLine() + TILE_HEIGHT;
if (k < 0) {
if (GetTreeGround(tile) != TREE_GROUND_SNOW_DESERT) return;