Add node timer back in so fires burn out

This commit is contained in:
cora 2022-01-14 23:01:12 +01:00 committed by Nils Dagsson Moskopp
parent 8e8ccddb68
commit df4ea94dbc
No known key found for this signature in database
GPG key ID: A3BC671C35191080

View file

@ -85,10 +85,6 @@ local fire_death_messages = {
N("@1 died in a fire."),
}
local fire_timer = function(pos)
minetest.get_node_timer(pos):start(math.random(3, 7))
end
local spawn_fire = function(pos, age)
minetest.set_node(pos, {name="mcl_fire:fire", param2 = age})
minetest.check_single_for_falling({x=pos.x, y=pos.y+1, z=pos.z})
@ -126,6 +122,14 @@ minetest.register_node("mcl_fire:fire", {
end,
drop = "",
sounds = {},
on_timer= function(pos)
if not minetest.find_node_near(pos, 1, {"group:flammable"}) then
minetest.remove_node(pos)
return
end
-- Restart timer
return true
end,
-- Turn into eternal fire on special blocks, light Nether portal (if possible), start burning timer
on_construct = function(pos)
local bpos = {x=pos.x, y=pos.y-1, z=pos.z}
@ -139,8 +143,7 @@ minetest.register_node("mcl_fire:fire", {
if minetest.get_modpath("mcl_portals") then
mcl_portals.light_nether_portal(pos)
end
fire_timer(pos)
minetest.get_node_timer(pos):start(math.random(30, 60))
spawn_smoke(pos)
end,
on_destruct = function(pos)