mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-19 01:21:05 +01:00
Improve some trees code
This commit is contained in:
parent
a2087b19a5
commit
4d29fab932
1 changed files with 2 additions and 2 deletions
|
@ -28,8 +28,8 @@ function mcl_core.update_leaves(pos, oldnode)
|
||||||
local leaves = minetest.find_nodes_in_area(pos1, pos2, "group:leaves")
|
local leaves = minetest.find_nodes_in_area(pos1, pos2, "group:leaves")
|
||||||
for _, lpos in pairs(leaves) do
|
for _, lpos in pairs(leaves) do
|
||||||
lnode = minetest.get_node(lpos)
|
lnode = minetest.get_node(lpos)
|
||||||
-- skip already decaying leaf nodes and player leaves
|
-- skip already decaying leaf nodes
|
||||||
if minetest.get_item_group(lnode.name, "orphan_leaves") ~= 1 and minetest.get_item_group(lnode.name, "player_leaves") ~= 1 then
|
if minetest.get_item_group(lnode.name, "orphan_leaves") ~= 1 then
|
||||||
if not minetest.find_node_near(lpos, 6, "group:tree") then
|
if not minetest.find_node_near(lpos, 6, "group:tree") then
|
||||||
local orphan_name = lnode.name .. "_orphan"
|
local orphan_name = lnode.name .. "_orphan"
|
||||||
local def = minetest.registered_nodes[orphan_name]
|
local def = minetest.registered_nodes[orphan_name]
|
||||||
|
|
Loading…
Reference in a new issue