fire flamable when temp high

This commit is contained in:
proller 2013-10-29 17:23:38 +04:00
parent a5ffa1e2f3
commit 558f7aa72a

View file

@ -190,3 +190,23 @@ minetest.register_abm({
end, end,
}) })
-- too hot
if minetest.setting_getbool("weather") then
minetest.register_abm({
nodenames = {"group:flammable"},
interval = 5,
chance = 5,
action = function(p0, node, _, _)
-- If there is water or stuff like that around flame, don't ignite
if minetest.get_heat(p0) < 500 then return end
if fire.flame_should_extinguish(p0) then
return
end
local p = fire.find_pos_for_flame_around(p0)
if p then
minetest.set_node(p, {name="fire:basic_flame"})
fire.on_flame_add_at(p)
end
end,
})
end