Fix some bugs WRT eternal fire spawning

This commit is contained in:
Wuzzy 2017-08-17 04:56:14 +02:00
parent 5c5c2ea109
commit 02f46da152
1 changed files with 5 additions and 2 deletions

View File

@ -379,8 +379,11 @@ local eternal_override = {
_on_ignite = function(player, pointed_thing) _on_ignite = function(player, pointed_thing)
local pos = pointed_thing.under local pos = pointed_thing.under
local flame_pos = {x = pos.x, y = pos.y + 1, z = pos.z} local flame_pos = {x = pos.x, y = pos.y + 1, z = pos.z}
if minetest.get_node(flame_pos).name == "air" then local fn = minetest.get_node(flame_pos)
if fn.name == "air" and not minetest.is_protected(flame_pos, "fire") and pointed_thing.under.y < pointed_thing.above.y then
minetest.set_node(flame_pos, {name = "mcl_fire:eternal_fire"}) minetest.set_node(flame_pos, {name = "mcl_fire:eternal_fire"})
else
mcl_fire.set_fire(pointed_thing)
end end
end, end,
} }
@ -393,7 +396,7 @@ end
-- Set pointed_thing on (normal) fire -- Set pointed_thing on (normal) fire
mcl_fire.set_fire = function(pointed_thing) mcl_fire.set_fire = function(pointed_thing)
local n = minetest.get_node(pointed_thing.above) local n = minetest.get_node(pointed_thing.above)
if n.name ~= "" and n.name == "air" and not minetest.is_protected(pointed_thing.above, "fire") then if n.name == "air" and not minetest.is_protected(pointed_thing.above, "fire") then
minetest.add_node(pointed_thing.above, {name="mcl_fire:fire"}) minetest.add_node(pointed_thing.above, {name="mcl_fire:fire"})
end end
end end