Changeset - r24490:3acfc75bc844
[Not reviewed]
master
0 1 0
Pavel Stupnikov - 4 years ago 2020-12-24 23:36:45
dp@dpointer.org
Fix: Don't lower tree density if spreading is not enabled (#8413)
1 file changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/tree_cmd.cpp
Show inline comments
 
@@ -681,7 +681,7 @@ static void TileLoop_Trees(TileIndex til
 
						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 til
 
			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)) {
0 comments (0 inline, 0 general)