From 9a1372849283b302bc6e73d83494734d5e445a78 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 21 Jan 2015 13:42:20 +0100 Subject: [PATCH] fix the medicine cabinet deleting inventory on punch --- homedecor/misc-bathroom.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homedecor/misc-bathroom.lua b/homedecor/misc-bathroom.lua index e3760493..6da386f2 100644 --- a/homedecor/misc-bathroom.lua +++ b/homedecor/misc-bathroom.lua @@ -89,8 +89,8 @@ minetest.register_node('homedecor:medicine_cabinet', { groups = { snappy = 3 }, sounds = default.node_sound_wood_defaults(), on_punch = function(pos, node, puncher, pointed_thing) - local fdir = node.param2 - minetest.set_node(pos, { name = "homedecor:medicine_cabinet_open", param2 = fdir }) + node.name = "homedecor:medicine_cabinet_open" + minetest.swap_node(pos, node) end, on_construct = function(pos) local meta = minetest.get_meta(pos) @@ -149,8 +149,8 @@ minetest.register_node("homedecor:medicine_cabinet_open", { }, drop = "homedecor:medicine_cabinet", on_punch = function(pos, node, puncher, pointed_thing) - local fdir = node.param2 - minetest.set_node(pos, { name = "homedecor:medicine_cabinet", param2 = fdir }) + node.name = "homedecor:medicine_cabinet" + minetest.swap_node(pos, node) end, })