forked from Mineclonia/Mineclonia
Fix torch placement on rightclickable nodes
This commit is contained in:
parent
95cdf7c00a
commit
711ec5f38c
|
@ -49,9 +49,13 @@ mcl_torches.register_torch = function(substring, description, icon, mesh_floor,
|
||||||
local under = pointed_thing.under
|
local under = pointed_thing.under
|
||||||
local node = minetest.get_node(under)
|
local node = minetest.get_node(under)
|
||||||
local def = minetest.registered_nodes[node.name]
|
local def = minetest.registered_nodes[node.name]
|
||||||
if def and def.on_rightclick then
|
local node = minetest.get_node(pointed_thing.under)
|
||||||
return def.on_rightclick(under, node, placer, itemstack,
|
|
||||||
pointed_thing) or itemstack, false
|
-- 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
|
end
|
||||||
|
|
||||||
local above = pointed_thing.above
|
local above = pointed_thing.above
|
||||||
|
|
Loading…
Reference in New Issue