From 5d1f2e2c01ab772824dd6396dc432004f316dcff Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Wed, 22 Feb 2017 21:11:48 +0000 Subject: Added nil player check when digging protectors (thanks expertmm) --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 72e92df..3499ad8 100644 --- a/init.lua +++ b/init.lua @@ -442,7 +442,7 @@ minetest.register_node("protector:protect", { can_dig = function(pos, player) - return protector.can_dig(1, pos, player:get_player_name(), true, 1) + return player and protector.can_dig(1, pos, player:get_player_name(), true, 1) end, on_blast = function() end, @@ -522,7 +522,7 @@ minetest.register_node("protector:protect2", { can_dig = function(pos, player) - return protector.can_dig(1, pos, player:get_player_name(), true, 1) + return player and protector.can_dig(1, pos, player:get_player_name(), true, 1) end, on_blast = function() end, -- cgit v1.2.3