Skip to content

Commit

Permalink
Dont place doors if node under it has on_rightclick
Browse files Browse the repository at this point in the history
  • Loading branch information
PilzAdam committed Mar 1, 2013
1 parent 230747c commit 6c70e02
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mods/doors/init.lua
Expand Up @@ -41,6 +41,13 @@ function doors:register_door(name, def)
if not pointed_thing.type == "node" then
return itemstack
end

local ptu = pointed_thing.under
local nu = minetest.env:get_node(ptu)
if minetest.registered_nodes[nu.name].on_rightclick then
return minetest.registered_nodes[nu.name].on_rightclick(ptu, nu, placer, itemstack)
end

local pt = pointed_thing.above
local pt2 = {x=pt.x, y=pt.y, z=pt.z}
pt2.y = pt2.y+1
Expand Down

0 comments on commit 6c70e02

Please sign in to comment.