Fix broken door protection.
authorAuke Kok <sofar@foo-projects.org>
Sat, 20 Feb 2016 08:41:22 +0000 (00:41 -0800)
committerparamat <mat.gregory@virginmedia.com>
Tue, 23 Feb 2016 20:34:23 +0000 (20:34 +0000)
A previous fix overwrote the `def` variable during registration,
causing protected doors no longer to be placed with protection.

mods/doors/init.lua

index 5a27459c16ab1c6b7396f52c92ff415bf4a1504f..c0f35536808a994e87902ac34dc722931bb1d285 100644 (file)
@@ -209,19 +209,19 @@ function doors.register(name, def)
                        end
 
                        local node = minetest.get_node(pointed_thing.under)
-                       local def = minetest.registered_nodes[node.name]
-                       if def and def.on_rightclick then
-                               return def.on_rightclick(pointed_thing.under,
+                       local pdef = minetest.registered_nodes[node.name]
+                       if pdef and pdef.on_rightclick then
+                               return pdef.on_rightclick(pointed_thing.under,
                                                node, placer, itemstack)
                        end
 
-                       if def and def.buildable_to then
+                       if pdef and pdef.buildable_to then
                                pos = pointed_thing.under
                        else
                                pos = pointed_thing.above
                                node = minetest.get_node(pos)
-                               def = minetest.registered_nodes[node.name]
-                               if not def or not def.buildable_to then
+                               pdef = minetest.registered_nodes[node.name]
+                               if not pdef or not pdef.buildable_to then
                                        return itemstack
                                end
                        end