Fix anonymous digging of non-empty machine

The quarry was causing crashes when it reached a machine that was
undiggable due to containing items.
This commit is contained in:
Zefram 2014-11-06 10:29:53 +00:00 committed by Vanessa Ezekowitz
parent 7c6c3b9679
commit f205e5f404

View File

@ -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