Fix random crash when piston breaks node with no player

This commit is contained in:
seventeenthShulker 2023-10-16 22:07:52 +02:00
parent 378df76e5f
commit 520fd773fb

View file

@ -741,7 +741,8 @@ if minetest.is_creative_enabled("") then
for _, item in ipairs(drops) do
minetest.add_item(pos, item)
end
end
else
-- If there is a player
local inv = digger:get_inventory()
if inv then
for _, item in ipairs(drops) do
@ -752,6 +753,7 @@ if minetest.is_creative_enabled("") then
end
end
end
end
minetest.register_on_joinplayer(function(player)
-- Initialize variables and inventory