Bug fix attempt
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Mon, 13 Nov 2017 12:18:37 +0000 (13:18 +0100)
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Mon, 13 Nov 2017 12:18:37 +0000 (13:18 +0100)
init.lua

index 26aa1d9..bb2c35b 100644 (file)
--- a/init.lua
+++ b/init.lua
@@ -55,8 +55,12 @@ minetest.register_node("feedlot:feedlot", {
                             insert_object = function(pos, node, stack, direction)
                                local meta = minetest.get_meta(pos)
                                local inv = meta:get_inventory()
-                               local added = inv:add_item("main", stack)
-                               return added
+                               if inv:room_for_item("main", stack) then
+                                  inv:set_stack("main", 1, stack)
+                                  return ItemStack(nil)
+                               else
+                                  return stack
+                               end
                             end,
                             can_insert = function(pos, node, stack, direction)
                                local meta = minetest.get_meta(pos)