milo: cleanup

This commit is contained in:
kepler155c
2018-11-23 11:39:39 -05:00
parent 7498276573
commit fa43186d52
13 changed files with 326 additions and 347 deletions

View File

@@ -205,7 +205,7 @@ function Craft.craftRecipeInternal(recipe, count, storage, origItem)
_G._debug({'eval', recipe.result, count })
local maxCount = recipe.maxCount or math.floor(64 / recipe.count)
local maxCount = math.floor((recipe.maxCount or 64) / recipe.count)
for key,icount in pairs(Craft.sumIngredients(recipe)) do
local itemCount = Craft.getItemCount(origItem.ingredients, key)

View File

@@ -1,5 +1,5 @@
local Config = require('config')
local Craft = require('turtle.craft')
local Craft = require('craft2')
local itemDB = require('itemDB')
local Util = require('util')

View File

@@ -287,20 +287,6 @@ function Storage:export(target, slot, count, item)
-- If no slot and full amount is not exported, then no need to check rest of adapters
-- ... so should not reach here
--[[
-- not found - scan all others
for _, adapter in self:onlineAdapters() do
if not adapter.cache or not adapter.cache[key] then
provide(adapter)
if count <= 0 then
_G._debug('STORAGE: FOUND: %s - %d', key, count)
break
end
end
end
--]]
return total
end
@@ -368,7 +354,7 @@ function Storage:import(source, slot, count, item)
if count <= 0 then
return total
end
if adapter.cache and adapter.cache[key] and not node.lock then
if not node.lock and adapter.cache and adapter.cache[key] then
insert(adapter)
end
end