Xuerian / XLoot

World of Warcraft addon enhancing loot related functionality
Other
10 stars 1 forks source link

LUA error after the last update #9

Closed Nillx closed 1 year ago

Nillx commented 1 year ago

Got this error after the new update today.

2x XLoot_Group\Group-Group.lua:236: Usage: GetItemQualityColor(index)
[string "=[C]"]: in function `GetItemQualityColor'
[string "@XLoot_Group\Group-Group.lua"]:236: in function `?'
[string "@XLoot\XLoot-9.2.7-1.lua"]:39: in function <XLoot\XLoot.lua:37>
[string "=[C]"]: in function `ConfirmLootRoll'
[string "@Leatrix_Plus\Leatrix_Plus-3.0.06.alpha.5.lua"]:11820: in function <Leatrix_Plus\Leatrix_Plus.lua:11712>
[string "=[C]"]: ?
[string "@XLoot_Group\Group-Group.lua"]:743: in function <XLoot_Group\Group.lua:742>

Locals:
(*temporary) = nil
Xuerian commented 1 year ago

What version are you playing on?

When is this error occurring?

How are you installing the addon?

Nillx commented 1 year ago

3.4.0, Curseforge app. It happened once so far, think while i was doing Onyxia 60lvl.

Xuerian commented 1 year ago

Was there a loot roll that you actually missed or did it just happen? (I believe the builtin history command is /loot)

Builtin LootFrame has a check that would avoid that error, but it would mean that junk roll events happen.

Try inserting these lines before line 235 (Before "local link = ")

    if name == nil then
        print('XLoot Group: Ignoring START_LOOT_ROLL with no name data')
        return
    end
Nillx commented 1 year ago

It just happened. Where exactly do i insert this?

Xuerian commented 1 year ago

Sorry. XLoot_Group/Group.lua line 235.

It should look like this:

function addon:START_LOOT_ROLL(id, length, uid, ongoing)
    local icon, name, count, quality, bop, need, greed, de, reason_need, reason_greed, reason_de, de_skill = GetLootRollItemInfo(id)
    if name == nil then
        print('XLoot Group: Ignoring START_LOOT_ROLL with no name data')
        return
    end
    local link = GetLootRollItemLink(id)
    local r, g, b = GetItemQualityColor(quality)
Nillx commented 1 year ago

Done. Now i wait for it to happen again or?

Xuerian commented 1 year ago

Yes. It should print a message if it happens, but shouldn't error.

The question is why START_LOOT_ROLL is passing information about a roll that isn't.. valid.

If we just need to ignore it, this will work fine. You'll see the message ("ignoring START_.."). If you see this message, please check /loot to confirm didn't miss a valid roll.

Nillx commented 1 year ago

Okey ill let you know if it happen again.