1) Dinv now avoids unnecessary warning and error messages if you attempt to access a snapshot

that includes items you no longer possess.  It will wear/display any available items that
   you still have but it will not complain if you no longer have everything in the snapshot.
master
Durel 6 years ago
parent b9982c8086
commit c15caa650d

@ -6322,7 +6322,7 @@ function inv.items.identifyItem(objId, idCommand, resultData, commandArray)
-- put the item back to its original location once we finish identifying it. -- put the item back to its original location once we finish identifying it.
local objLoc = inv.items.getField(objId, invFieldObjLoc) local objLoc = inv.items.getField(objId, invFieldObjLoc)
if (objLoc == nil) or (objLoc == invItemLocUninitialized) then if (objLoc == nil) or (objLoc == invItemLocUninitialized) then
dbot.warn("inv.items.identifyItem: Failed to identify item " .. objId .. dbot.debug("inv.items.identifyItem: Failed to identify item " .. objId ..
": item's location could not be determined") ": item's location could not be determined")
inv.items.table[objId] = nil inv.items.table[objId] = nil
return DRL_RET_MISSING_ENTRY return DRL_RET_MISSING_ENTRY
@ -7057,8 +7057,8 @@ function inv.items.getItem(objId, commandArray)
end -- if end -- if
if (itemLoc == nil) then if (itemLoc == nil) then
dbot.error("inv.items.getItem: item location for objId " .. objId .. " is missing") dbot.debug("inv.items.getItem: item location for objId " .. objId .. " is missing")
retval = DRL_RET_INTERNAL_ERROR retval = DRL_RET_MISSING_ENTRY
else else
local itemLocNum = tonumber(itemLoc) local itemLocNum = tonumber(itemLoc)
@ -7683,8 +7683,11 @@ function inv.items.wearItem(objId, targetLoc, commandArray, doCheckLocation)
-- Start with the item in your main inventory -- Start with the item in your main inventory
retval = inv.items.getItem(objId, commandArray) retval = inv.items.getItem(objId, commandArray)
if (retval ~= DRL_RET_SUCCESS) then if (retval ~= DRL_RET_SUCCESS) then
if (retval ~= DRL_RET_MISSING_ENTRY) then
dbot.warn("inv.items.wearItem: Failed to get item \"" .. itemName .. "\": " .. dbot.warn("inv.items.wearItem: Failed to get item \"" .. itemName .. "\": " ..
dbot.retval.getString(retval)) dbot.retval.getString(retval))
end -- if
return retval return retval
end -- if end -- if
end -- if end -- if
@ -14388,10 +14391,14 @@ function inv.set.displaySet(setName, level, equipSet)
locColor = "@Y" locColor = "@Y"
end -- if end -- if
local objName = inv.items.getField(objId, invFieldColorName)
if (objName ~= nil) and (objName ~= "") then
dbot.print(locColor .. " " .. string.format("%08s", v) .. "@W(" .. string.format("%4d", score) .. dbot.print(locColor .. " " .. string.format("%08s", v) .. "@W(" .. string.format("%4d", score) ..
"): @GLevel " .. "): @GLevel " ..
string.format("%3d", inv.items.getStatField(objId, invStatFieldLevel) or 0) .. string.format("%3d", inv.items.getStatField(objId, invStatFieldLevel) or 0) ..
"@W \"" .. (inv.items.getField(objId, invFieldColorName) or "Unidentified") .. "\"") "@W \"" .. objName .. "\"")
end -- if
end -- if end -- if
end -- for end -- for

Loading…
Cancel
Save