Skip to content

Commit

Permalink
Trees: fix decay
Browse files Browse the repository at this point in the history
  • Loading branch information
proller committed Dec 13, 2023
1 parent 90b0e1d commit 24362f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/content_abm_grow_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ class GrowLeaves : public ActiveBlockModifier
}

// Slowly evaporate water and kill leaves with water_level==1
const auto can_decay = !have_not_leaves && nbh[D_SELF].light < LIGHT_SUN - 1;
const auto can_decay = have_not_leaves && nbh[D_SELF].light < LIGHT_SUN - 1;
if (n_water_level > 1 && can_decay &&
(!myrand_range(0, 10 * (grow_debug_fast ? 1 : 10)))) {
float humidity = map->updateBlockHumidity(env, pos);
Expand All @@ -1034,7 +1034,7 @@ class GrowLeaves : public ActiveBlockModifier
(n_water_level == 1 && can_decay &&
(!myrand_range(0, 30 * (grow_debug_fast ? 1 : 10)))) ||
(n_water_level >= 1 && // dont touch old static trees
!have_not_leaves &&
have_not_leaves &&
((nbh[D_SELF].light < params.leaves_die_light_max &&
(nbh[D_SELF].light > 0 || activate ||
!myrand_range(0, params.leaves_die_chance))) ||
Expand Down

0 comments on commit 24362f8

Please sign in to comment.