From: paramat Date: Thu, 30 Mar 2017 04:06:49 +0000 (+0100) Subject: Leafdecay: Do not restart aready running timers X-Git-Tag: 0.4.16~35 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9e4f0d368969d2b80ac93cf64bc9fe4a5fad614f;p=oweals%2Fminetest_game.git Leafdecay: Do not restart aready running timers --- 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