From f205e5f4047aa251d2a30f5df3b8a1c48dc827c9 Mon Sep 17 00:00:00 2001 From: Zefram Date: Thu, 6 Nov 2014 10:29:53 +0000 Subject: [PATCH] Fix anonymous digging of non-empty machine The quarry was causing crashes when it reached a machine that was undiggable due to containing items. --- technic/machines/register/common.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/technic/machines/register/common.lua b/technic/machines/register/common.lua index 0e59d0e..c9f8b5d 100644 --- a/technic/machines/register/common.lua +++ b/technic/machines/register/common.lua @@ -122,8 +122,10 @@ function technic.machine_can_dig(pos, player) local inv = meta:get_inventory() if not inv:is_empty("src") or not inv:is_empty("dst") or not inv:is_empty("upgrade1") or not inv:is_empty("upgrade2") then - minetest.chat_send_player(player:get_player_name(), - S("Machine cannot be removed because it is not empty")) + if player then + minetest.chat_send_player(player:get_player_name(), + S("Machine cannot be removed because it is not empty")) + end return false else return true -- 2.30.2