Bug fix attempt

This commit is contained in:
Gabriel Pérez-Cerezo 2017-11-13 13:18:37 +01:00
parent f674a7ea9f
commit 264cd0f84e
No known key found for this signature in database
GPG Key ID: 90422B01A46D0B3E

View File

@ -55,8 +55,12 @@ minetest.register_node("feedlot:feedlot", {
insert_object = function(pos, node, stack, direction) insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
local added = inv:add_item("main", stack) if inv:room_for_item("main", stack) then
return added inv:set_stack("main", 1, stack)
return ItemStack(nil)
else
return stack
end
end, end,
can_insert = function(pos, node, stack, direction) can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)