Skip to content

set comparison: set not worn but object worn #41

@linkendel

Description

@linkendel

How to reproduct the issue:
you need 2 sets, let's say "dps" and "tank".
one of your ring is part of both sets but in different slots
the other ring of "tank" set is lesser than the ring in both sets.
you are currently wearing "dps" set
you check the tooltip of the ring in both sets

Then, the comparison for the "tank" set is wrong because it will compare the ring in both sets to the lesser ring instead of detecting that it is already in the set.

The issue is in Tooltip.lua, in GetComparedItem(link, spec).
In line 144 you use EquipmentManager_UnpackLocation(location); to get the bag in which the item to compare to is. But it is actually worn, so the result of this function is: bag = null, but bagSlot is valid.
You just have to handle this case, like that:

                local _, _, _, _, bagSlot, bag = EquipmentManager_UnpackLocation(location);
                if bag then
                    equippedLink = GetContainerItemLink(bag, bagSlot);
                    set = spec.EquipmentSet;
                else
                    if bagSlot then
                       equippedLink = GetInventoryItemLink("player", bagSlot);
                       set = spec.EquipmentSet;                           
                    end
                end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions