mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 10:31:06 +01:00
Fix random crash when piston breaks node with no player
This commit is contained in:
parent
378df76e5f
commit
520fd773fb
1 changed files with 8 additions and 6 deletions
|
@ -741,12 +741,14 @@ if minetest.is_creative_enabled("") then
|
|||
for _, item in ipairs(drops) do
|
||||
minetest.add_item(pos, item)
|
||||
end
|
||||
end
|
||||
local inv = digger:get_inventory()
|
||||
if inv then
|
||||
for _, item in ipairs(drops) do
|
||||
if not inv:contains_item("main", item, true) then
|
||||
inv:add_item("main", item)
|
||||
else
|
||||
-- If there is a player
|
||||
local inv = digger:get_inventory()
|
||||
if inv then
|
||||
for _, item in ipairs(drops) do
|
||||
if not inv:contains_item("main", item, true) then
|
||||
inv:add_item("main", item)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue