1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-12-23 08:20:21 +01:00

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, end,
after_dig_node = function(pos, oldnode, oldmetadata, digger) after_dig_node = function(pos, oldnode, oldmetadata, digger)
local fdir = oldnode.param2 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] } 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 if minetest.get_node(pos2).name == "homedecor:bed_blue_head" then
minetest.remove_node(pos2) minetest.remove_node(pos2)

View File

@ -803,6 +803,7 @@ minetest.register_node("homedecor:pool_table", {
end, end,
after_dig_node = function(pos, oldnode, oldmetadata, digger) after_dig_node = function(pos, oldnode, oldmetadata, digger)
local fdir = oldnode.param2 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] } 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 if minetest.get_node(pos2).name == "homedecor:pool_table2" then
minetest.remove_node(pos2) minetest.remove_node(pos2)

View File

@ -473,6 +473,7 @@ minetest.register_node("homedecor:desk", {
end, end,
after_dig_node = function(pos, oldnode, oldmetadata, digger) after_dig_node = function(pos, oldnode, oldmetadata, digger)
local fdir = oldnode.param2 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] } 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 if minetest.get_node(pos2).name == "homedecor:desk_r" then
minetest.remove_node(pos2) minetest.remove_node(pos2)