forked from thunderdog1138/star_wars
Leafdecay: Do not restart aready running timers
This commit is contained in:
parent
acfd58cdeb
commit
9e4f0d3689
|
@ -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),
|
for _, v in pairs(minetest.find_nodes_in_area(vector.subtract(pos, def.radius),
|
||||||
vector.add(pos, def.radius), def.leaves)) do
|
vector.add(pos, def.radius), def.leaves)) do
|
||||||
local node = minetest.get_node(v)
|
local node = minetest.get_node(v)
|
||||||
if node.param2 == 0 then
|
local timer = minetest.get_node_timer(v)
|
||||||
minetest.get_node_timer(v):start(math.random(20, 120) / 10)
|
if node.param2 == 0 and not timer:is_started() then
|
||||||
|
timer:start(math.random(20, 120) / 10)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue