1.7.10 compatibility

This commit is contained in:
kepler155c
2018-03-21 11:34:28 -04:00
parent dce51a0903
commit 9986857ef1
2 changed files with 11 additions and 2 deletions

View File

@@ -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()

View File

@@ -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