Skip to content

Commit

Permalink
Clean up door tops if fire destroys bottom.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sofar authored and paramat committed Mar 13, 2016
1 parent 20053d6 commit dfee51c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mods/doors/init.lua
Expand Up @@ -339,6 +339,10 @@ function doors.register(name, def)
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", {
description = def.description,
visual = "mesh",
Expand All @@ -361,6 +365,7 @@ function doors.register(name, def)
can_dig = def.can_dig,
on_rotate = def.on_rotate,
on_blast = def.on_blast,
on_destruct = def.on_destruct,
selection_box = {
type = "fixed",
fixed = { -1/2,-1/2,-1/2,1/2,3/2,-6/16}
Expand Down Expand Up @@ -393,6 +398,7 @@ function doors.register(name, def)
can_dig = def.can_dig,
on_rotate = def.on_rotate,
on_blast = def.on_blast,
on_destruct = def.on_destruct,
selection_box = {
type = "fixed",
fixed = { -1/2,-1/2,-1/2,1/2,3/2,-6/16}
Expand Down

0 comments on commit dfee51c

Please sign in to comment.