Skip to content
Snippets Groups Projects
Commit 6b055ae1 authored by Auke Kok's avatar Auke Kok Committed by paramat
Browse files

Fix broken door protection.

A previous fix overwrote the `def` variable during registration,
causing protected doors no longer to be placed with protection.
parent 4c9944b2
No related branches found
No related tags found
No related merge requests found
...@@ -209,19 +209,19 @@ function doors.register(name, def) ...@@ -209,19 +209,19 @@ function doors.register(name, def)
end end
local node = minetest.get_node(pointed_thing.under) local node = minetest.get_node(pointed_thing.under)
local def = minetest.registered_nodes[node.name] local pdef = minetest.registered_nodes[node.name]
if def and def.on_rightclick then if pdef and pdef.on_rightclick then
return def.on_rightclick(pointed_thing.under, return pdef.on_rightclick(pointed_thing.under,
node, placer, itemstack) node, placer, itemstack)
end end
if def and def.buildable_to then if pdef and pdef.buildable_to then
pos = pointed_thing.under pos = pointed_thing.under
else else
pos = pointed_thing.above pos = pointed_thing.above
node = minetest.get_node(pos) node = minetest.get_node(pos)
def = minetest.registered_nodes[node.name] pdef = minetest.registered_nodes[node.name]
if not def or not def.buildable_to then if not pdef or not pdef.buildable_to then
return itemstack return itemstack
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment