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

View File

@ -187,20 +187,15 @@ minetest.register_node("lightning:dying_flame", {
sunlight_propagates = true, sunlight_propagates = true,
damage_per_second = 4, damage_per_second = 4,
groups = {dig_immediate = 3}, groups = {dig_immediate = 3},
on_timer = function(pos)
minetest.remove_node(pos)
end,
drop = "", drop = "",
on_construct = function(pos) on_construct = function(pos)
minetest.after(0, fire.on_flame_add_at, pos) minetest.get_node_timer(pos):start(rng:next(20, 40))
minetest.after(rng:next(20, 40), minetest.remove_node, pos) minetest.after(0.5, fire.on_flame_add_at, pos)
end, 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
}) })