Fix doors dropping duplicate when blown up

This commit is contained in:
Lizzy Fleckenstein 2021-01-17 12:00:00 +01:00
parent b54b6c4c97
commit fa9d4402c7
1 changed files with 7 additions and 5 deletions

View File

@ -275,7 +275,7 @@ function mcl_doors:register_door(name, def)
paramtype2 = "facedir",
sunlight_propagates = true,
is_ground_content = false,
drop = name,
drop = "",
drawtype = "nodebox",
node_box = {
type = "fixed",
@ -291,6 +291,7 @@ function mcl_doors:register_door(name, def)
sounds = def.sounds,
after_destruct = function(bottom, oldnode)
minetest.add_item(bottom, name)
local top = { x = bottom.x, y = bottom.y + 1, z = bottom.z }
if minetest.get_node(bottom).name ~= name.."_b_2" and minetest.get_node(top).name == name.."_t_1" then
minetest.remove_node(top)
@ -394,7 +395,7 @@ function mcl_doors:register_door(name, def)
paramtype2 = "facedir",
sunlight_propagates = true,
is_ground_content = false,
drop = name,
drop = "",
drawtype = "nodebox",
node_box = {
type = "fixed",
@ -410,6 +411,7 @@ function mcl_doors:register_door(name, def)
sounds = def.sounds,
after_destruct = function(bottom, oldnode)
minetest.add_item(bottom, name)
local top = { x = bottom.x, y = bottom.y + 1, z = bottom.z }
if minetest.get_node(bottom).name ~= name.."_b_1" and minetest.get_node(top).name == name.."_t_2" then
minetest.remove_node(top)