Fix random crash when piston breaks node with no player
parent
378df76e5f
commit
520fd773fb
|
@ -741,12 +741,14 @@ if minetest.is_creative_enabled("") then
|
||||||
for _, item in ipairs(drops) do
|
for _, item in ipairs(drops) do
|
||||||
minetest.add_item(pos, item)
|
minetest.add_item(pos, item)
|
||||||
end
|
end
|
||||||
end
|
else
|
||||||
local inv = digger:get_inventory()
|
-- If there is a player
|
||||||
if inv then
|
local inv = digger:get_inventory()
|
||||||
for _, item in ipairs(drops) do
|
if inv then
|
||||||
if not inv:contains_item("main", item, true) then
|
for _, item in ipairs(drops) do
|
||||||
inv:add_item("main", item)
|
if not inv:contains_item("main", item, true) then
|
||||||
|
inv:add_item("main", item)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue