diff options
author | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2017-11-13 13:18:37 +0100 |
---|---|---|
committer | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2017-11-13 13:18:37 +0100 |
commit | 264cd0f84e40fe5cb7eaa7e2cfd30b09818f174d (patch) | |
tree | b3a9f1f55e823230ac124b802c460efcf103038d /init.lua | |
parent | f674a7ea9f76c1004f9cc64676bbc374441e31b0 (diff) |
Bug fix attempt
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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) |