mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-20 22:33:16 -04:00
fire flamable when temp high
This commit is contained in:
parent
a5ffa1e2f3
commit
558f7aa72a
1 changed files with 20 additions and 0 deletions
|
@ -190,3 +190,23 @@ minetest.register_abm({
|
|||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue