diff --git a/stock-manager.lua b/stock-manager.lua index 520b9bc..43ef4c8 100644 --- a/stock-manager.lua +++ b/stock-manager.lua @@ -29,10 +29,7 @@ function remove_waste(source, discard_rest) if amounts_to_keep[item.name] ~= nil then local excess = item.count - amounts_to_keep[item.name][1] if excess > 0 then - amounts_to_keep[item.name][1] = 0 discard(item, excess, amounts_to_keep[item.name][2]) - else - amounts_to_keep[item.name][1] = -excess end elseif DISCARD_REST then discard(item, amt, DISCARD_ADDR)