Stanzilla / WoWUIBugs

World of Warcraft UI Bug Tracker
153 stars 7 forks source link

C_CurrencyInfo.GetCurrencyListInfo returns incomplete data #509

Open InfusOnWoW opened 7 months ago

InfusOnWoW commented 7 months ago

I would expect C_CurrencyInfo.GetCurrencyListInfo(index) to return the same info as C_CurrencyInfo.GetCurrencyInfo(id).

The below example code compares the data returned for these two methods for all known currencies, and shows that for several properties the data returned from C_CurrencyInfo.GetCurrencyListInfo is different and as far as I can tell always wrong.

Affected properties are: "description", "discovered", "isTypeUnused", "maxWeeklyQuantity", "canEarnPerWeek", "trackedQuantity", "useTotalEarnedForMaxQty", "totalEarned",

C_Timer.After(15, function()
    for index = 1, C_CurrencyInfo.GetCurrencyListSize() do
        local currencyLink = C_CurrencyInfo.GetCurrencyListLink(index)
        if currencyLink then
            local currencyInfoViaId = C_CurrencyInfo.GetCurrencyInfo(C_CurrencyInfo.GetCurrencyIDFromLink(currencyLink))
            local currencyInfoList = C_CurrencyInfo.GetCurrencyListInfo(index)
            for k in pairs(currencyInfoList) do
                if currencyInfoViaId[k] ~= currencyInfoList[k] then
                    print("###", currencyInfoViaId.name, '"'.. k .. '"',
                          "via id:", currencyInfoViaId[k], 
                         "via list:", currencyInfoList[k])
                end
            end
        end
    end
end)