This commit is contained in:
kepler155c
2018-10-31 19:38:54 -04:00
parent 4d3a896d6b
commit 865d642e5c
16 changed files with 276 additions and 234 deletions

View File

@@ -9,14 +9,15 @@ function LimitTask:cycle(context)
local trashcan = context.storage:filterActive('trashcan')()
if trashcan then
for _,res in pairs(context.resources) do
for k,res in pairs(context.resources) do
if res.limit then
local item = Milo:getItemWithQty(res, res.ignoreDamage, res.ignoreNbtHash)
if item and item.count > res.limit then
-- TODO: change to export method of finding items (maybe)
local item, count = Milo:getItemWithQty(Milo:splitKey(k), res.ignoreDamage, res.ignoreNbtHash)
if item and count > res.limit then
context.storage:export(
trashcan.name,
nil,
item.count - res.limit,
count - res.limit,
item)
end
end