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,8 +6322,8 @@ 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
end -- if end -- if
@ -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
dbot.warn("inv.items.wearItem: Failed to get item \"" .. itemName .. "\": " .. if (retval ~= DRL_RET_MISSING_ENTRY) then
dbot.retval.getString(retval)) dbot.warn("inv.items.wearItem: Failed to get item \"" .. itemName .. "\": " ..
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
dbot.print(locColor .. " " .. string.format("%08s", v) .. "@W(" .. string.format("%4d", score) .. local objName = inv.items.getField(objId, invFieldColorName)
"): @GLevel " .. if (objName ~= nil) and (objName ~= "") then
string.format("%3d", inv.items.getStatField(objId, invStatFieldLevel) or 0) .. dbot.print(locColor .. " " .. string.format("%08s", v) .. "@W(" .. string.format("%4d", score) ..
"@W \"" .. (inv.items.getField(objId, invFieldColorName) or "Unidentified") .. "\"") "): @GLevel " ..
string.format("%3d", inv.items.getStatField(objId, invStatFieldLevel) or 0) ..
"@W \"" .. objName .. "\"")
end -- if
end -- if end -- if
end -- for end -- for

Loading…
Cancel
Save