aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeha <shacknetisp@mail.com>2021-06-16 12:04:18 -0400
committerBeha <shacknetisp@mail.com>2021-06-16 12:04:18 -0400
commit0e5d0a54572573ac8ff0004ac5526d78a9f20a30 (patch)
tree5f14b3c89cb8059bb4fd571a9f5af8490e3e4f4d
parent7ab4e03313085aadd0d6e8e5adeaf882a7a578d8 (diff)
downloadelevator-0e5d0a54572573ac8ff0004ac5526d78a9f20a30.tar.gz
elevator-0e5d0a54572573ac8ff0004ac5526d78a9f20a30.tar.bz2
elevator-0e5d0a54572573ac8ff0004ac5526d78a9f20a30.zip
Allow node placing for elevator components on top of box.
-rw-r--r--components.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/components.lua b/components.lua
index 14fd5d9..490ecf4 100644
--- a/components.lua
+++ b/components.lua
@@ -298,17 +298,17 @@ for _,mode in ipairs({"on", "off"}) do
return minetest.item_place(itemstack, placer, pointed_thing)
end,
- on_rightclick = function(pos, node, sender)
+ on_rightclick = function(pos, node, sender, itemstack, pointed_thing)
if not sender or not sender:is_player() then
return
end
- -- Don't do anything when the player is holding elevator components.
+ -- When the player is holding elevator components, just place them instead of opening the formspec.
if ({
["elevator:elevator_off"] = true,
["elevator:shaft"] = true,
["elevator:motor"] = true,
})[sender:get_wielded_item():get_name()] then
- return
+ return core.item_place_node(itemstack, sender, pointed_thing)
end
local formspec
local meta = minetest.get_meta(pos)