Fix torch placement on rightclickable nodes

This commit is contained in:
Wuzzy 2017-03-02 15:32:42 +01:00
parent 95cdf7c00a
commit 711ec5f38c

View file

@ -49,9 +49,13 @@ mcl_torches.register_torch = function(substring, description, icon, mesh_floor,
local under = pointed_thing.under
local node = minetest.get_node(under)
local def = minetest.registered_nodes[node.name]
if def and def.on_rightclick then
return def.on_rightclick(under, node, placer, itemstack,
pointed_thing) or itemstack, false
local node = minetest.get_node(pointed_thing.under)
-- Call on_rightclick if the pointed node defines it
if placer and not placer:get_player_control().sneak then
if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then
return minetest.registered_nodes[node.name].on_rightclick(under, node, placer, itemstack) or itemstack
end
end
local above = pointed_thing.above