summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPavel Stupnikov <dp@dpointer.org>2020-12-25 02:36:45 +0300
committerGitHub <noreply@github.com>2020-12-25 00:36:45 +0100
commit04e572933d3752ee23d14206a78e3d944ca42c2f (patch)
tree23eb8646518757e204be32e6751819e23d46e14b /src
parent94d629d79bcd623a5c77daa3db742cd8fd43d7b4 (diff)
downloadopenttd-04e572933d3752ee23d14206a78e3d944ca42c2f.tar.xz
Fix: Don't lower tree density if spreading is not enabled (#8413)
Diffstat (limited to 'src')
-rw-r--r--src/tree_cmd.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp
index cdc986920..8c7f9ea31 100644
--- a/src/tree_cmd.cpp
+++ b/src/tree_cmd.cpp
@@ -681,7 +681,7 @@ static void TileLoop_Trees(TileIndex tile)
break;
case 1: // add a tree
- if (GetTreeCount(tile) < 4) {
+ if (GetTreeCount(tile) < 4 && CanPlantExtraTrees(tile)) {
AddTreeCount(tile, 1);
SetTreeGrowth(tile, 0);
break;
@@ -713,13 +713,13 @@ static void TileLoop_Trees(TileIndex tile)
break;
case 6: // final stage of tree destruction
- if (GetTreeCount(tile) > 1) {
+ if (!CanPlantExtraTrees(tile)) {
+ /* if trees can't spread just plant a new one to prevent deforestation */
+ SetTreeGrowth(tile, 0);
+ } else if (GetTreeCount(tile) > 1) {
/* more than one tree, delete it */
AddTreeCount(tile, -1);
SetTreeGrowth(tile, 3);
- } else if (!CanPlantExtraTrees(tile)) {
- /* if trees can't spread just plant a new one to prevent deforestation */
- SetTreeGrowth(tile, 0);
} else {
/* just one tree, change type into MP_CLEAR */
switch (GetTreeGround(tile)) {