doors: record protection violation if it cannot be dug
authorupsilon <upsilon@langg.net>
Sat, 25 Mar 2017 16:18:17 +0000 (17:18 +0100)
committerparamat <mat.gregory@virginmedia.com>
Sun, 26 Mar 2017 02:06:44 +0000 (03:06 +0100)
mods/doors/init.lua

index 2b3d094aa723ba3dd21bafc8a436d990b95b0db5..974e9d3d5dce9ca9e398bcf184d0cb739af5f5c4 100644 (file)
@@ -203,7 +203,12 @@ end
 
 local function can_dig_door(pos, digger)
        replace_old_owner_information(pos)
-       return default.can_interact_with_node(digger, pos)
+       if default.can_interact_with_node(digger, pos) then
+               return true
+       else
+               minetest.record_protection_violation(pos, digger:get_player_name())
+               return false
+       end
 end
 
 function doors.register(name, def)