Players added to protector can punch to see protected area
authorTenPlus1 <kinsellaja@yahoo.com>
Tue, 26 Apr 2016 14:23:44 +0000 (15:23 +0100)
committerTenPlus1 <kinsellaja@yahoo.com>
Tue, 26 Apr 2016 14:23:44 +0000 (15:23 +0100)
init.lua

index ebedb4a..24628d6 100644 (file)
--- a/init.lua
+++ b/init.lua
@@ -331,7 +331,7 @@ minetest.register_node("protector:protect", {
 
        on_punch = function(pos, node, puncher)
 
-               if not protector.can_dig(1, pos, puncher:get_player_name(), true, 1) then
+               if minetest.is_protected(pos, puncher:get_player_name()) then
                        return
                end
 
@@ -412,7 +412,7 @@ minetest.register_node("protector:protect2", {
 
        on_punch = function(pos, node, puncher)
 
-               if not protector.can_dig(1, pos, puncher:get_player_name(), true, 1) then
+               if minetest.is_protected(pos, puncher:get_player_name()) then
                        return
                end