Skip to content
Snippets Groups Projects
Commit ec4f2237 authored by Gael-de-Sailly's avatar Gael-de-Sailly
Browse files

Drop item when inventory is full (bushes_classic)

parent ecf175fb
No related branches found
No related tags found
No related merge requests found
......@@ -86,8 +86,13 @@ plantlife_bushes.after_dig_node = function(pos, oldnode, oldmetadata, digger)
-- give the harvested result to the player
if harvested then
--minetest.chat_send_player("singleplayer","you would now get "..tostring( harvested ) );
local itemstack = ItemStack(harvested)
local inventory = digger:get_inventory()
inventory:add_item( "main", harvested );
if inventory:room_for_item("main", itemstack) then
inventory:add_item("main", itemstack)
else
minetest.item_drop(itemstack, digger, pos)
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment