forked from VoxeLibre/VoxeLibre
Fix incomplete door destruction code
This fixes doors being destroyed by activating an End portal
This commit is contained in:
parent
62364a65ca
commit
219e6ff146
|
@ -227,7 +227,7 @@ function mcl_doors:register_door(name, def)
|
||||||
|
|
||||||
after_destruct = function(bottom, oldnode)
|
after_destruct = function(bottom, oldnode)
|
||||||
local top = { x = bottom.x, y = bottom.y + 1, z = bottom.z }
|
local top = { x = bottom.x, y = bottom.y + 1, z = bottom.z }
|
||||||
if minetest.get_node(bottom).name == "air" and minetest.get_node(top).name == name.."_t_1" then
|
if minetest.get_node(bottom).name ~= name.."_b_2" and minetest.get_node(top).name == name.."_t_1" then
|
||||||
minetest.remove_node(top)
|
minetest.remove_node(top)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
@ -274,7 +274,7 @@ function mcl_doors:register_door(name, def)
|
||||||
|
|
||||||
after_destruct = function(top, oldnode)
|
after_destruct = function(top, oldnode)
|
||||||
local bottom = { x = top.x, y = top.y - 1, z = top.z }
|
local bottom = { x = top.x, y = top.y - 1, z = top.z }
|
||||||
if minetest.get_node(top).name == "air" and minetest.get_node(bottom).name == name.."_b_1" and oldnode.name == name.."_t_1" then
|
if minetest.get_node(top).name ~= name.."_t_2" and minetest.get_node(bottom).name == name.."_b_1" and oldnode.name == name.."_t_1" then
|
||||||
minetest.dig_node(bottom)
|
minetest.dig_node(bottom)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
@ -317,7 +317,7 @@ function mcl_doors:register_door(name, def)
|
||||||
|
|
||||||
after_destruct = function(bottom, oldnode)
|
after_destruct = function(bottom, oldnode)
|
||||||
local top = { x = bottom.x, y = bottom.y + 1, z = bottom.z }
|
local top = { x = bottom.x, y = bottom.y + 1, z = bottom.z }
|
||||||
if minetest.get_node(bottom).name == "air" and minetest.get_node(top).name == name.."_t_2" then
|
if minetest.get_node(bottom).name ~= name.."_b_1" and minetest.get_node(top).name == name.."_t_2" then
|
||||||
minetest.remove_node(top)
|
minetest.remove_node(top)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
@ -364,7 +364,7 @@ function mcl_doors:register_door(name, def)
|
||||||
|
|
||||||
after_destruct = function(top, oldnode)
|
after_destruct = function(top, oldnode)
|
||||||
local bottom = { x = top.x, y = top.y - 1, z = top.z }
|
local bottom = { x = top.x, y = top.y - 1, z = top.z }
|
||||||
if minetest.get_node(top).name == "air" and minetest.get_node(bottom).name == name.."_b_2" and oldnode.name == name.."_t_2" then
|
if minetest.get_node(top).name ~= name.."_t_1" and minetest.get_node(bottom).name == name.."_b_2" and oldnode.name == name.."_t_2" then
|
||||||
minetest.dig_node(bottom)
|
minetest.dig_node(bottom)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Reference in New Issue