mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-05 07:13:51 +01:00
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 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
|
||||
|
Loading…
Reference in New Issue
Block a user