1.7.10 compatibility
This commit is contained in:
@@ -74,6 +74,7 @@ end
|
||||
|
||||
function MEAdapter:refresh()
|
||||
self.items = nil
|
||||
local hasItems
|
||||
|
||||
local s, m = pcall(function()
|
||||
self.items = self.getAvailableItems('all')
|
||||
@@ -81,6 +82,13 @@ function MEAdapter:refresh()
|
||||
Util.merge(v, v.item)
|
||||
convertItem(v)
|
||||
|
||||
-- if power has been interrupted, the list will still be returned
|
||||
-- but all items will have a 0 quantity
|
||||
-- ensure that the list is valid
|
||||
if not hasItems then
|
||||
hasItems = v.qty > 0
|
||||
end
|
||||
|
||||
if not itemDB:get(v) then
|
||||
itemDB:add(v, v)
|
||||
end
|
||||
@@ -92,9 +100,10 @@ function MEAdapter:refresh()
|
||||
debug(m)
|
||||
end
|
||||
|
||||
if s and not Util.empty(self.items) then
|
||||
if s and hasItems and not Util.empty(self.items) then
|
||||
return self.items
|
||||
end
|
||||
self.items = nil
|
||||
end
|
||||
|
||||
function MEAdapter:listItems()
|
||||
|
||||
@@ -1180,7 +1180,7 @@ local function learnRecipe(page)
|
||||
if not recipe then
|
||||
debug(results)
|
||||
debug(newRecipe)
|
||||
error('Failed')
|
||||
error('Failed - view system log')
|
||||
end
|
||||
|
||||
newRecipe.count = recipe.count
|
||||
|
||||
Reference in New Issue
Block a user