From 812bb323f66f119e9cd258dec8ef2ffd9d643103 Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Thu, 14 Apr 2022 21:04:28 -0400 Subject: [PATCH] Verify object is player before checking privs backported for mt 0.4.17 game * backported https://github.com/minetest/minetest_game/commit/3a3f71aa50c7ef5d894d1f1e0760f164654bbeb7 * prevents a crash when a 'nil' digger is passed by the engine to minetest.node_dig --- mods/default/functions.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/default/functions.lua b/mods/default/functions.lua index 4c8d2f0..b12f03e 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -543,7 +543,8 @@ minetest.register_abm({ -- function default.can_interact_with_node(player, pos) - if player then + if player == nil then return false end + if player and player:is_player() then if minetest.check_player_privs(player, "protection_bypass") then return true end