Skip to content

Commit

Permalink
Rare tree grow without light
Browse files Browse the repository at this point in the history
  • Loading branch information
proller committed Jan 22, 2024
1 parent 7573231 commit 466c48d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion games/default
Submodule default updated 1 files
+2 −2 mods/tnt/init.lua
4 changes: 3 additions & 1 deletion src/content_abm_grow_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ along with Freeminer. If not, see <http://www.gnu.org/licenses/>.

#include <cmath>
#include <cstdint>
#include "light.h"
#include "mapnode.h"
#include "nodedef.h"
#include "server.h"
Expand Down Expand Up @@ -397,7 +398,8 @@ class GrowTree : public ActiveBlockModifier
for (int i = D_SELF + 1; i <= D_BOTTOM; ++i) {
auto &nb = nbh[i];
const bool allow_grow_by_light =
!nb.top || nb.light <= params.tree_grow_light_max;
(!nb.top || (nb.light <= params.tree_grow_light_max &&
!myrand_range(0, LIGHT_MAX - nb.light)));
bool up_all_leaves = true;
//DUMP("gr", i, nb.top, nb.bottom, allow_grow_by_light, nb.water_level, nb.is_leaves, nb.is_tree, nb.is_liquid, nb.is_soil);

Expand Down

0 comments on commit 466c48d

Please sign in to comment.