Make the flame with a nodetimer instead.

This is more robust, and won't remove other nodes placed
at the same pos accidentally.
This commit is contained in:
Auke Kok 2016-03-10 13:00:03 -08:00
parent 9bdcdafae2
commit b8724822b6
1 changed files with 5 additions and 10 deletions

View File

@ -187,20 +187,15 @@ minetest.register_node("lightning:dying_flame", {
sunlight_propagates = true,
damage_per_second = 4,
groups = {dig_immediate = 3},
on_timer = function(pos)
minetest.remove_node(pos)
end,
drop = "",
on_construct = function(pos)
minetest.after(0, fire.on_flame_add_at, pos)
minetest.after(rng:next(20, 40), minetest.remove_node, pos)
minetest.get_node_timer(pos):start(rng:next(20, 40))
minetest.after(0.5, fire.on_flame_add_at, pos)
end,
on_destruct = function(pos)
minetest.after(0, fire.on_flame_remove_at, pos)
minetest.after(rng:next(20, 40), minetest.remove_node, pos)
end,
on_blast = function()
end, -- unaffected by explosions
})