Skip to content

Commit

Permalink
Tune tree grow
Browse files Browse the repository at this point in the history
  • Loading branch information
proller committed Sep 10, 2023
1 parent d6473e2 commit e84897d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/content_abm_grow_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -893,8 +893,9 @@ class GrowLeaves : public ActiveBlockModifier
++i;
}

const auto can_decrease = nbh[D_SELF].light < LIGHT_SUN - 1;
if (n_water_level > 1 && can_decrease &&
// Slowly evaporate water and kill leaves with water_level==1
const auto can_decay = have_air && 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);
if (humidity < params.tree_get_water_from_humidity)
Expand All @@ -908,7 +909,7 @@ class GrowLeaves : public ActiveBlockModifier
(grow_debug_fast || !myrand_range(0, params.leaves_to_fruit_chance))) {
map->setNode(pos, {c_fruit});
} else if (
(n_water_level == 1 && can_decrease &&
(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_air &&
Expand Down

0 comments on commit e84897d

Please sign in to comment.