LibItemCache-2.0

LibItemCache-2.0

936 Downloads

Caged BattlePet handling

ckaotik opened this issue ยท 1 comments

commented

It seems to me that Lib:GetItemInfo(player, bag, slot) doesn't properly recognize (and handle) battle pet links. Running this ingame on a caged pet:

    local icon, count, locked, quality, readable, lootable, link = GetContainerItemInfo(bag, slot)
    -- returns: "INTERFACE\ICONS\ACHIEVEMENT_BOSS_THEBLACKSTALKER.BLP", 1, nil, -1, nil, nil, "|cff1eff00|Hbattlepet:308:1:2:151:10:10:0x0000000000000000|h[Beinchen]|h|r", false

The example is an uncommon pet, as indicated by :2: in the pet link, however the quality return is -1, meaning additional checks are required to get this working properly.
Also, it seems that this pattern no longer matches:

    local PetDataFormat = '^' .. strrep('%d+:', 6) .. '%d+$'

Getting this fixed would also help get pet quality highlighting, as requested in Jaliborc/Bagnon#183 :)

commented

Dam, wish they didn't keep changing that link format all the time... dam