prevent crash if screwdriver was able to rotate a part of bed, pool table,

or desk.  (really anything that is a side-by-side object).
This commit is contained in:
Vanessa Ezekowitz 2014-08-14 15:34:35 -04:00
parent e5ec7c88e8
commit 365247b7c3
3 changed files with 3 additions and 0 deletions

View File

@ -352,6 +352,7 @@ minetest.register_node("homedecor:bed_blue_foot", {
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local fdir = oldnode.param2
if not fdir or fdir > 3 then return end
local pos2 = { x = pos.x + fdir_to_fwd[fdir+1][1], y=pos.y, z = pos.z + fdir_to_fwd[fdir+1][2] }
if minetest.get_node(pos2).name == "homedecor:bed_blue_head" then
minetest.remove_node(pos2)

View File

@ -803,6 +803,7 @@ minetest.register_node("homedecor:pool_table", {
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local fdir = oldnode.param2
if not fdir or fdir > 3 then return end
local pos2 = { x = pos.x + fdir_to_fwd[fdir+1][1], y=pos.y, z = pos.z + fdir_to_fwd[fdir+1][2] }
if minetest.get_node(pos2).name == "homedecor:pool_table2" then
minetest.remove_node(pos2)

View File

@ -473,6 +473,7 @@ minetest.register_node("homedecor:desk", {
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local fdir = oldnode.param2
if not fdir or fdir > 3 then return end
local pos2 = { x = pos.x + fdir_to_right[fdir+1][1], y=pos.y, z = pos.z + fdir_to_right[fdir+1][2] }
if minetest.get_node(pos2).name == "homedecor:desk_r" then
minetest.remove_node(pos2)