Rain now extinguishes fire, lightning now always makes fire

This commit is contained in:
Wuzzy 2017-02-20 21:43:10 +01:00
parent 1c6f1591da
commit f023a1962f
2 changed files with 4 additions and 7 deletions

@ -150,11 +150,8 @@ lightning.strike = function(pos)
pos2.y = pos2.y + 1/2 pos2.y = pos2.y + 1/2
if minetest.get_item_group(minetest.get_node({x = pos2.x, y = pos2.y - 1, z = pos2.z}).name, "liquid") < 1 then if minetest.get_item_group(minetest.get_node({x = pos2.x, y = pos2.y - 1, z = pos2.z}).name, "liquid") < 1 then
if minetest.get_node(pos2).name == "air" then if minetest.get_node(pos2).name == "air" then
-- Rarely cause a fire -- Cause a fire
-- TODO: Always cause a fire, but the rain should put out fires then minetest.set_node(pos2, {name = "mcl_fire:fire"})
if rng:next(1, 100) == 1 then
minetest.set_node(pos2, {name = "mcl_fire:fire"})
end
end end
end end

@ -172,7 +172,7 @@ end
-- ABM for extinguish fire -- ABM for extinguish fire
if weather.allow_abm then if weather.allow_abm then
minetest.register_abm({ minetest.register_abm({
nodenames = {"fire:basic_flame"}, nodenames = {"mcl_fire:fire"},
interval = 4.0, interval = 4.0,
chance = 2, chance = 2,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
@ -183,4 +183,4 @@ if weather.allow_abm then
end end
end end
}) })
end end