Only allow rotating nodes that could be dug
authorPilzAdam <pilzadam@minetest.net>
Sun, 7 Dec 2014 20:29:54 +0000 (21:29 +0100)
committerPilzAdam <pilzadam@minetest.net>
Fri, 12 Dec 2014 15:14:25 +0000 (16:14 +0100)
mods/screwdriver/init.lua

index 4aadaa0a2bf578b09b33e367431f9a24d1f99ceb..49ea615662fd1719044a8816ff3a3bd741e8779f 100644 (file)
@@ -32,6 +32,10 @@ local function screwdriver_handler(itemstack, user, pointed_thing, mode)
                return
        end
 
+       if ndef.can_dig and not ndef.can_dig(pos, user) then
+               return
+       end
+
        -- Set param2
        local n = node.param2
        local axisdir = math.floor(n / 4)