summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2017-02-22 21:11:48 +0000
committerTenPlus1 <kinsellaja@yahoo.com>2017-02-22 21:11:48 +0000
commit5d1f2e2c01ab772824dd6396dc432004f316dcff (patch)
tree4433b179b562076e5800b953c8a7418312fde627
parent3e3e24dbefc75159dc442dec165ff141416659fb (diff)
Added nil player check when digging protectors (thanks expertmm)
-rw-r--r--init.lua4
1 files 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,