Efficiency for heavily-used abm.

This commit is contained in:
Aaron Suen 2019-02-09 23:00:38 -05:00
parent b5bd67d5a7
commit b02af51b20

View File

@ -13,12 +13,13 @@ nodecore.register_limited_abm({
limited_alert = 1000,
nodenames = {modname .. ":leaves"},
action = function(pos)
if not nodecore.scan_flood(pos, 5, function(p)
if nodecore.match(p, modname .. ":tree")
or nodecore.match(p, "ignore") then
if not nodecore.scan_flood(pos, 3, function(p)
local n = minetest.get_node(p).name
if n == modname .. ":tree"
or n == "ignore" then
return true
end
if nodecore.match(p, modname .. ":leaves") then
if n == modname .. ":leaves" then
return
end
return false