Fix leaf decay at borders of the active block area
authorPerttu Ahola <celeron55@gmail.com>
Sat, 31 Mar 2012 13:37:23 +0000 (16:37 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 31 Mar 2012 13:37:23 +0000 (16:37 +0300)
mods/default/leafdecay.lua

index a3df9eb71f7d620f7139ca9224f144273e00f976..a01fe6168baab259aa706eeb939c6dcd158869e3 100644 (file)
@@ -38,7 +38,8 @@ minetest.register_abm({
                        if trunkp then
                                local n = minetest.env:get_node(trunkp)
                                local reg = minetest.registered_nodes[n.name]
-                               if reg.groups.tree and reg.groups.tree ~= 0 then
+                               -- Assume ignore is a trunk, to make the thing work at the border of the active area
+                               if n.name == "ignore" or (reg.groups.tree and reg.groups.tree ~= 0) then
                                        --print("cached trunk still exists")
                                        return
                                end
@@ -57,7 +58,8 @@ minetest.register_abm({
                        }
                        local n = minetest.env:get_node(p)
                        local reg = minetest.registered_nodes[n.name]
-                       if reg.groups.tree and reg.groups.tree ~= 0 then
+                       -- Assume ignore is a trunk, to make the thing work at the border of the active area
+                       if n.name == "ignore" or (reg.groups.tree and reg.groups.tree ~= 0) then
                                do_preserve = true
                                if default.leafdecay_enable_cache then
                                        --print("caching trunk")