From c62a4a549a338648f929272bae15f54f6b10adbd Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Fri, 8 Feb 2013 14:31:35 -0500 Subject: [PATCH] fixed hacky on_rightclick/on_place code for doors. They work better now. --- door_nodes.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/door_nodes.lua b/door_nodes.lua index 68d3f4d..1b9d82e 100644 --- a/door_nodes.lua +++ b/door_nodes.lua @@ -158,11 +158,13 @@ for i in ipairs(sides) do end end, on_place = function(itemstack, placer, pointed_thing) + + + --[[ -- for some obscure reason, this callback is used if the target node -- is a homedecor door, probably because they have an on_rightclick -- setting -- but only if you're weilding a door! - local node=minetest.env:get_node(pointed_thing.under) if string.find(node.name, "homedecor:door_") then local lr = nil @@ -184,11 +186,13 @@ for i in ipairs(sides) do print(node.name) print(dname) print(lr) + ]]-- - homedecor_flip_door(pointed_thing.under, node, placer, dname, lr) - return - else + local node=minetest.env:get_node(pointed_thing.under) + if not minetest.registered_nodes[node.name].on_rightclick then return homedecor_place_door(itemstack, placer, pointed_thing, doorname, side) + else + minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer) end end, on_rightclick = function(pos, node, clicker)