From 9e4f0d368969d2b80ac93cf64bc9fe4a5fad614f Mon Sep 17 00:00:00 2001 From: paramat Date: Thu, 30 Mar 2017 05:06:49 +0100 Subject: [PATCH] Leafdecay: Do not restart aready running timers --- mods/default/functions.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mods/default/functions.lua b/mods/default/functions.lua index 8e9132d0..2268263e 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -330,8 +330,9 @@ local function leafdecay_after_destruct(pos, oldnode, def) for _, v in pairs(minetest.find_nodes_in_area(vector.subtract(pos, def.radius), vector.add(pos, def.radius), def.leaves)) do local node = minetest.get_node(v) - if node.param2 == 0 then - minetest.get_node_timer(v):start(math.random(20, 120) / 10) + local timer = minetest.get_node_timer(v) + if node.param2 == 0 and not timer:is_started() then + timer:start(math.random(20, 120) / 10) end end end -- 2.25.1