mirror of
https://github.com/joe7575/techpack.git
synced 2024-08-20 05:04:08 +02:00
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:
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
|
||||||
|
Loading…
Reference in New Issue
Block a user