Clean up door tops if fire destroys bottom.

Fixes #909. Door tops are never flammable.

This doesn't guard yet against a voxelmanip removing the top node,
but that is less of an issue since if a voxelmanip removes the top,
then the bottom part remains functional and visibly intact. If the
voxelmanip removes the bottom part, but not the top, then this patch
makes it clean up the top just fine.
This commit is contained in:
Auke Kok
2016-03-11 22:11:39 -08:00
committed by paramat
부모 20053d6b52
커밋 dfee51c21e

파일 보기

@@ -339,6 +339,10 @@ function doors.register(name, def)
end end
end end
def.on_destruct = function(pos)
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
end
minetest.register_node(":" .. name .. "_a", { minetest.register_node(":" .. name .. "_a", {
description = def.description, description = def.description,
visual = "mesh", visual = "mesh",
@@ -361,6 +365,7 @@ function doors.register(name, def)
can_dig = def.can_dig, can_dig = def.can_dig,
on_rotate = def.on_rotate, on_rotate = def.on_rotate,
on_blast = def.on_blast, on_blast = def.on_blast,
on_destruct = def.on_destruct,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { -1/2,-1/2,-1/2,1/2,3/2,-6/16} fixed = { -1/2,-1/2,-1/2,1/2,3/2,-6/16}
@@ -393,6 +398,7 @@ function doors.register(name, def)
can_dig = def.can_dig, can_dig = def.can_dig,
on_rotate = def.on_rotate, on_rotate = def.on_rotate,
on_blast = def.on_blast, on_blast = def.on_blast,
on_destruct = def.on_destruct,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { -1/2,-1/2,-1/2,1/2,3/2,-6/16} fixed = { -1/2,-1/2,-1/2,1/2,3/2,-6/16}