diff --git a/core.lua b/core.lua index 2360923..7c2d785 100644 --- a/core.lua +++ b/core.lua @@ -383,16 +383,15 @@ end -- returns which of the items values is the highest (value, type) function BrokerGarbage:GetSingleItemValue(item) local hasData = item and GetItemInfo(item) or nil - BrokerGarbage:Debug("GetSingleItemValue("..(item or "?")..")", hasData) - - local hasData, itemLink, itemQuality, itemLevel, vendorPrice = GetItemInfo(item) local itemID = itemLink and BrokerGarbage:GetItemID(itemLink) or nil - - if not hasData or not itemID then -- invalid argument - BrokerGarbage:Debug("Error! GetSingleItemValue: Failed on "..(itemLink or "<unknown>")..".") - return nil - end + BrokerGarbage:Debug("GetSingleItemValue("..(item or "?")..")", hasData) + local hasData, itemLink, itemQuality, itemLevel, _, itemType, _, _, _, _, vendorPrice = GetItemInfo(item) + if not hasData then -- invalid argument + BrokerGarbage:Debug("Error! GetSingleItemValue: Failed on "..(itemLink or item or "<unknown>")..".", hasData) + return nil + end + -- ignore AH prices for gray items if not itemQuality or itemQuality == 0 then return vendorPrice, vendorPrice and BrokerGarbage.VENDOR @@ -442,7 +441,6 @@ function BrokerGarbage:GetSingleItemValue(item) if canDE and not disenchantPrice and IsAddOnLoaded("Enchantrix") then disenchantPrice = 0 - local itemType = select(6, GetItemInfo(itemID)) local weaponString, armorString = GetAuctionItemClasses() if itemType == weaponString then itemType = 2 @@ -451,10 +449,15 @@ function BrokerGarbage:GetSingleItemValue(item) end local enchItemQuality = Enchantrix.Constants.baseDisenchantTable[itemQuality] + BrokerGarbage:Debug("Auc-Advanced: Available data?", itemLink, itemQuality, itemLevel, itemType, + enchItemQuality and "EIQ" or "no EIQ", + enchItemQuality and enchItemQuality[itemType] and "EIQ[type]" or "no EIQ[type]", + enchItemQuality and enchItemQuality[itemType] and enchItemQuality[itemType][itemLevel] and "EIQ[type][Level]" or "no EIQ[type][level]") if itemQuality and itemLevel and enchItemQuality then while not enchItemQuality[itemType][itemLevel] and itemLevel < 800 do itemLevel = itemLevel + 1 end + BrokerGarbage:Debug(enchItemQuality and enchItemQuality[itemType] and enchItemQuality[itemType][itemLevel] and "EIQ[type][Level]" or "no EIQ[type][level]") DEMats = Enchantrix.Constants.baseDisenchantTable[itemQuality][itemType][itemLevel] if DEMats then diff --git a/helper.lua b/helper.lua index 3de577e..2343dbb 100644 --- a/helper.lua +++ b/helper.lua @@ -468,11 +468,11 @@ end function BrokerGarbage:UpdateCache(itemID) if not itemID then return nil end local class, temp, limit - -- TODO: maybe a second call to getiteminfo is needed? + local hasData, itemLink, quality, _, _, _, subClass, stackSize, invType, _, value = GetItemInfo(itemID) local family = GetItemFamily(itemID) - if not hasData or not itemLink or not quality then - BrokerGarbage:Debug("Could not retrieve quality information for "..(itemID or "<none>").." ("..(itemLink or "")..")") + if not hasData then + BrokerGarbage:Debug("UpdateCache("..(itemID or "<none>")..") failed - no GetItemInfo() data available!") return nil end @@ -616,6 +616,7 @@ function BrokerGarbage:GetCached(itemID) if not BrokerGarbage.itemsCache[itemID] then BrokerGarbage:UpdateCache(itemID) end + return BrokerGarbage.itemsCache[itemID] end diff --git a/libs/tekKonfig/tekKonfig.xml b/libs/tekKonfig/tekKonfig.xml index 2c07157..643421e 100644 --- a/libs/tekKonfig/tekKonfig.xml +++ b/libs/tekKonfig/tekKonfig.xml @@ -1,5 +1,4 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> -<Script file="LibStub.lua"/> <Script file="tekKonfigAboutPanel.lua"/> <Script file="tekKonfigButton.lua"/> <Script file="tekKonfigCheckbox.lua"/>