fermenter: return items to source inventory when faulted.

Items should be moved back to source inventory when machine fails
due to incorrect type of items there (game internal error).

Unused local variable removed.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
This commit is contained in:
Michal Cieslakiewicz 2019-02-07 12:56:23 +01:00
parent 54abd7bf55
commit fe3ff47bd2

@ -116,11 +116,13 @@ local function convert_leaves_to_biogas(pos, meta)
-- take NUM_LEAVES items -- take NUM_LEAVES items
local items = {} local items = {}
local fault = false
for i = 1, NUM_LEAVES do for i = 1, NUM_LEAVES do
items[i] = tubelib.get_num_items(meta, "src", 1) items[i] = tubelib.get_num_items(meta, "src", 1)
if items[i] then -- input available? if items[i] then -- input available?
if not is_leaves(items[i]:get_name()) then if not is_leaves(items[i]:get_name()) then
for j = 1, #items do
inv:add_item("src", items[j])
end
State:fault(pos, meta) State:fault(pos, meta)
return return
end end