From 711ec5f38cdce1b6ffc1ed5243a9986c051299ab Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 2 Mar 2017 15:32:42 +0100 Subject: [PATCH] Fix torch placement on rightclickable nodes --- mods/ITEMS/mcl_torches/init.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_torches/init.lua b/mods/ITEMS/mcl_torches/init.lua index 9810908662..58d491cde0 100644 --- a/mods/ITEMS/mcl_torches/init.lua +++ b/mods/ITEMS/mcl_torches/init.lua @@ -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