mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-03-15 12:21:24 +00:00
Fixed doors - rightclick
When the wielded object is a door, call on_rightclick instead of place a door
This commit is contained in:
parent
230747c748
commit
202e71f9a6
1 changed files with 6 additions and 0 deletions
|
@ -41,6 +41,12 @@ function doors:register_door(name, def)
|
|||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local n = minetest.env:get_node(pointed_thing.under)
|
||||
local nn = n.name
|
||||
if minetest.registered_nodes[nn] and minetest.registered_nodes[nn].on_rightclick then
|
||||
minetest.registered_nodes[nn].on_rightclick(pointed_thing.under, n, placer)
|
||||
return
|
||||
end
|
||||
local pt = pointed_thing.above
|
||||
local pt2 = {x=pt.x, y=pt.y, z=pt.z}
|
||||
pt2.y = pt2.y+1
|
||||
|
|
Loading…
Add table
Reference in a new issue