From 0410b5e0ca6d0f2ff58171b3f1a88e7f5996060d Mon Sep 17 00:00:00 2001 From: MT-Modder Date: Thu, 25 Feb 2016 18:05:23 -0500 Subject: [PATCH] Allow non-players to dig bones. --- mods/bones/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mods/bones/init.lua b/mods/bones/init.lua index 899ac809..c86deccd 100644 --- a/mods/bones/init.lua +++ b/mods/bones/init.lua @@ -43,7 +43,11 @@ minetest.register_node("bones:bones", { can_dig = function(pos, player) local inv = minetest.get_meta(pos):get_inventory() - return is_owner(pos, player:get_player_name()) and inv:is_empty("main") + local name = "" + if player then + name = player:get_player_name() + end + return is_owner(pos, name) and inv:is_empty("main") end, allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) -- 2.25.1