summaryrefslogtreecommitdiff
path: root/homedecor/window_treatments.lua
diff options
context:
space:
mode:
Diffstat (limited to 'homedecor/window_treatments.lua')
-rw-r--r--homedecor/window_treatments.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/homedecor/window_treatments.lua b/homedecor/window_treatments.lua
index 2d9b125..1b7f915 100644
--- a/homedecor/window_treatments.lua
+++ b/homedecor/window_treatments.lua
@@ -125,12 +125,13 @@ for c in ipairs(curtaincolors) do
paramtype2 = 'wallmounted',
selection_box = { type = "wallmounted" },
-- Open the curtains
- on_rightclick = function(pos, node, clicker, itemstack)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
if string.find(topnode.name, "homedecor:curtainrod") then
local fdir = node.param2
minetest.set_node(pos, { name = "homedecor:curtain_open_"..color, param2 = fdir })
end
+ return itemstack
end
})
@@ -147,12 +148,13 @@ for c in ipairs(curtaincolors) do
paramtype2 = 'wallmounted',
selection_box = { type = "wallmounted" },
-- Close the curtains
- on_rightclick = function(pos, node, clicker, itemstack)
+ on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
if string.find(topnode.name, "homedecor:curtainrod") then
local fdir = node.param2
minetest.set_node(pos, { name = "homedecor:curtain_"..color, param2 = fdir })
end
+ return itemstack
end
})