1.7.10 compatibility
This commit is contained in:
@@ -74,7 +74,7 @@ end
|
|||||||
|
|
||||||
function MEAdapter:refresh()
|
function MEAdapter:refresh()
|
||||||
self.items = nil
|
self.items = nil
|
||||||
local hasItems
|
local hasItems, failed
|
||||||
|
|
||||||
local s, m = pcall(function()
|
local s, m = pcall(function()
|
||||||
self.items = self.getAvailableItems('all')
|
self.items = self.getAvailableItems('all')
|
||||||
@@ -86,7 +86,12 @@ function MEAdapter:refresh()
|
|||||||
-- but all items will have a 0 quantity
|
-- but all items will have a 0 quantity
|
||||||
-- ensure that the list is valid
|
-- ensure that the list is valid
|
||||||
if not hasItems then
|
if not hasItems then
|
||||||
hasItems = v.qty > 0
|
hasItems = v.count > 0
|
||||||
|
end
|
||||||
|
|
||||||
|
if not v.fingerprint then
|
||||||
|
failed = true
|
||||||
|
break
|
||||||
end
|
end
|
||||||
|
|
||||||
if not itemDB:get(v) then
|
if not itemDB:get(v) then
|
||||||
@@ -100,7 +105,7 @@ function MEAdapter:refresh()
|
|||||||
debug(m)
|
debug(m)
|
||||||
end
|
end
|
||||||
|
|
||||||
if s and hasItems and not Util.empty(self.items) then
|
if s and not failed and hasItems and self.items and not Util.empty(self.items) then
|
||||||
return self.items
|
return self.items
|
||||||
end
|
end
|
||||||
self.items = nil
|
self.items = nil
|
||||||
|
|||||||
@@ -206,11 +206,13 @@ local function listItems()
|
|||||||
if items then
|
if items then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
os.sleep(.25)
|
jobList:showError('Error - retrying in 3 seconds')
|
||||||
|
os.sleep(3)
|
||||||
end
|
end
|
||||||
if not items then
|
if not items then
|
||||||
-- error('could not check inventory')
|
-- error('could not check inventory')
|
||||||
term.clear()
|
term.clear()
|
||||||
|
jobList:showError('Error - rebooting in 5 seconds')
|
||||||
print('Communication failure')
|
print('Communication failure')
|
||||||
print('rebooting in 5 secs')
|
print('rebooting in 5 secs')
|
||||||
os.sleep(5)
|
os.sleep(5)
|
||||||
|
|||||||
Reference in New Issue
Block a user