From e29e4e9dce7207abe1ccf339904bbc536f3d3db9 Mon Sep 17 00:00:00 2001 From: SFENCE Date: Mon, 11 Apr 2022 19:14:58 +0200 Subject: [PATCH] Fix item supply bug. --- item_supply.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/item_supply.lua b/item_supply.lua index d8da889..fa34274 100644 --- a/item_supply.lua +++ b/item_supply.lua @@ -22,7 +22,10 @@ if appliances.have_pipeworks then if self.recipes then if self.have_input then if (self.input_stack_size <= 1) then - return self:recipe_inventory_can_put(pos, self.input_stack, 1, stack, owner); + local can_insert = self:recipe_inventory_can_put(pos, self.input_stack, 1, stack, owner); + if (can_insert~=0) then + return can_insert; + end else for index = 1,self.input_stack_size do local can_insert = self:recipe_inventory_can_put(pos, self.input_stack, index, stack, owner); @@ -48,7 +51,10 @@ if appliances.have_pipeworks then if self.have_input then if (self.input_stack_size <= 1) then - return inv:add_item(self.input_stack, stack); + local can_insert = self:recipe_inventory_can_put(pos, self.input_stack, 1, stack, owner); + if can_insert~=0 then + return inv:add_item(self.input_stack, stack); + end else for index = 1,self.input_stack_size do local can_insert = self:recipe_inventory_can_put(pos, self.input_stack, index, stack, owner);