1.7.10 compatibility
This commit is contained in:
@@ -74,6 +74,7 @@ end
|
|||||||
|
|
||||||
function MEAdapter:refresh()
|
function MEAdapter:refresh()
|
||||||
self.items = nil
|
self.items = nil
|
||||||
|
local hasItems
|
||||||
|
|
||||||
local s, m = pcall(function()
|
local s, m = pcall(function()
|
||||||
self.items = self.getAvailableItems('all')
|
self.items = self.getAvailableItems('all')
|
||||||
@@ -81,6 +82,13 @@ function MEAdapter:refresh()
|
|||||||
Util.merge(v, v.item)
|
Util.merge(v, v.item)
|
||||||
convertItem(v)
|
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
|
if not itemDB:get(v) then
|
||||||
itemDB:add(v, v)
|
itemDB:add(v, v)
|
||||||
end
|
end
|
||||||
@@ -92,9 +100,10 @@ function MEAdapter:refresh()
|
|||||||
debug(m)
|
debug(m)
|
||||||
end
|
end
|
||||||
|
|
||||||
if s and not Util.empty(self.items) then
|
if s and hasItems and not Util.empty(self.items) then
|
||||||
return self.items
|
return self.items
|
||||||
end
|
end
|
||||||
|
self.items = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function MEAdapter:listItems()
|
function MEAdapter:listItems()
|
||||||
|
|||||||
@@ -1180,7 +1180,7 @@ local function learnRecipe(page)
|
|||||||
if not recipe then
|
if not recipe then
|
||||||
debug(results)
|
debug(results)
|
||||||
debug(newRecipe)
|
debug(newRecipe)
|
||||||
error('Failed')
|
error('Failed - view system log')
|
||||||
end
|
end
|
||||||
|
|
||||||
newRecipe.count = recipe.count
|
newRecipe.count = recipe.count
|
||||||
|
|||||||
Reference in New Issue
Block a user