Skip to content

Commit 9e4f0d3

Browse files
committedApr 11, 2017
Leafdecay: Do not restart aready running timers
1 parent acfd58c commit 9e4f0d3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

Diff for: ‎mods/default/functions.lua

+3-2
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,9 @@ local function leafdecay_after_destruct(pos, oldnode, def)
330330
for _, v in pairs(minetest.find_nodes_in_area(vector.subtract(pos, def.radius),
331331
vector.add(pos, def.radius), def.leaves)) do
332332
local node = minetest.get_node(v)
333-
if node.param2 == 0 then
334-
minetest.get_node_timer(v):start(math.random(20, 120) / 10)
333+
local timer = minetest.get_node_timer(v)
334+
if node.param2 == 0 and not timer:is_started() then
335+
timer:start(math.random(20, 120) / 10)
335336
end
336337
end
337338
end

0 commit comments

Comments
 (0)