Fix the chainsaw's protection check
authorShadowNinja <shadowninja@minetest.net>
Thu, 26 Jun 2014 20:53:38 +0000 (16:53 -0400)
committerShadowNinja <shadowninja@minetest.net>
Thu, 26 Jun 2014 20:53:38 +0000 (16:53 -0400)
technic/tools/chainsaw.lua

index 4a1bfd80e0e3e79541969ac7702f83f9326de817..503c0100e3e48af67a3fcfb8026c1360a30c40f7 100644 (file)
@@ -289,9 +289,9 @@ minetest.register_tool("technic:chainsaw", {
                end
 
                local name = user:get_player_name()
-               if minetest.is_protected(pos, name) then
-                       minetest.record_protection_violation(pos, name)
-                       return current_charge
+               if minetest.is_protected(pointed_thing.under, name) then
+                       minetest.record_protection_violation(pointed_thing.under, name)
+                       return
                end
 
                -- Send current charge to digging function so that the