fix the medicine cabinet deleting inventory on punch

This commit is contained in:
Tim 2015-01-21 13:42:20 +01:00
parent 2cd99d6462
commit 9a13728492

View File

@ -89,8 +89,8 @@ minetest.register_node('homedecor:medicine_cabinet', {
groups = { snappy = 3 }, groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
on_punch = function(pos, node, puncher, pointed_thing) on_punch = function(pos, node, puncher, pointed_thing)
local fdir = node.param2 node.name = "homedecor:medicine_cabinet_open"
minetest.set_node(pos, { name = "homedecor:medicine_cabinet_open", param2 = fdir }) minetest.swap_node(pos, node)
end, end,
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
@ -149,8 +149,8 @@ minetest.register_node("homedecor:medicine_cabinet_open", {
}, },
drop = "homedecor:medicine_cabinet", drop = "homedecor:medicine_cabinet",
on_punch = function(pos, node, puncher, pointed_thing) on_punch = function(pos, node, puncher, pointed_thing)
local fdir = node.param2 node.name = "homedecor:medicine_cabinet"
minetest.set_node(pos, { name = "homedecor:medicine_cabinet", param2 = fdir }) minetest.swap_node(pos, node)
end, end,
}) })