Verify object is player before checking privs (#2448)
authorcoil <51716565+coil0@users.noreply.github.com>
Mon, 19 Aug 2019 17:24:19 +0000 (13:24 -0400)
committerSmallJoker <SmallJoker@users.noreply.github.com>
Mon, 19 Aug 2019 17:24:19 +0000 (19:24 +0200)
This prevents a crash when a 'nil' digger is passed by the engine to
minetest.node_dig.

mods/default/functions.lua

index ceeeedc6dd3d02b1837a54b97d68bcd0d90176fe..0f3cb764ab088c6a603fa548c2bda689f6b8f385 100644 (file)
@@ -573,7 +573,7 @@ minetest.register_abm({
 --
 
 function default.can_interact_with_node(player, pos)
-       if player then
+       if player and player:is_player() then
                if minetest.check_player_privs(player, "protection_bypass") then
                        return true
                end