Questie

Questie

122M Downloads

Map/Minimap tooltips for quests with the same objective (item) are not displayed on the 2nd quest in the list

Cabro opened this issue ยท 14 comments

commented

Map/Minimap tooltips!

image

The last quest in the list - Footwraps of the Oracle (8596) has the same item objective as Mantle of the Oracle (8594), and recently the addon stopped showing the objective for the 2nd quest where the items are the same.
Easier to test would be i guess the Blasted Lands quests:
https://www.wowhead.com/wotlk/quest=2602/infallible-mind
https://www.wowhead.com/wotlk/quest=2604/spiritual-domination
https://www.wowhead.com/wotlk/quest=2601/the-basilisks-bite
https://www.wowhead.com/wotlk/quest=2603/vultures-vigor
https://www.wowhead.com/wotlk/quest=2582/rage-of-ages
https://www.wowhead.com/wotlk/quest=2586/salt-of-the-scorpok
https://www.wowhead.com/wotlk/quest=2584/spirit-of-the-boar

Where they require the same items (although in different quantities).

If that doesn't do the trick, you can just test with
https://www.wowhead.com/wotlk/quest=8352/scepter-of-the-council + https://www.wowhead.com/wotlk/quest=9248/a-humble-offering

Same item, same quantity

commented

Oh boy... yeah, it's the bug I fixed were we remove duplicate tooltips that's causing this...

commented

Actually, I misspoke... the bug I fixed pertained to Creature/NPC tooltips that were duplicated. However, I know enough about the Tooltip stacks that I think I know where to begin looking at why this is happening.

commented

shouldnt the code check if the objective is for the same quest before nuking it?

commented

Here is another one that is perfectly correct too...

image

Doesn't appear to be a "number of lines" issue. It's something else entirely... looks like I'll have something to do tomorrow during one of my boring meetings. :D

commented

So actually, the issue is that it's truncating the last line... here is a tooltip that the same item is needed for 3 quests.

image

commented

ANNNNDDD here is one that is perfectly correct...

image

commented

I was expecting the blasted lands quests to not cause the bug, since they are different objectives, multiple quantities also. The bug could show on the silithus quests for the abyssal scepter. If nothing else works, AQ40 class tier quests.

commented

Ahhhh... "since they are different objectives" I think that's it dude.

First screen shot... the first quest needs 2 Vulture Gizzards and so does the third quest. The other two screen shots... the objectives are different quantities even though they need the same item.

In other words, if your Footwraps of the Oracle (8596) needed 2 bindings it would not be broken.

commented

Everything leading up to this function worked perfectly...

function _MapIconTooltip:AddTooltipsForQuest(icon, tip, quest, usedText)
    for text, nameTable in pairs(tip) do
        local data = {}
        data[text] = nameTable;
        --Add the data for the first time
        if not usedText[text] then
            tinsert(quest, data)
            usedText[text] = true;

tinsert(quest, data) is the key line that adds the objective text to the quest title line in the tooltip. if not usedText[text] then looks for text already there. Since the "text" isn't unique to a specific quest... any duplicate gets skipped and thus it skips tinsert(quest, data).

Here is the fix:

function _MapIconTooltip:AddTooltipsForQuest(icon, tip, quest, usedText)
    for text, nameTable in pairs(tip) do
        local data = {}
        data[text] = nameTable
        --Add the data for the first time
        if not usedText[icon.data.Id] then
            usedText[icon.data.Id] = {}
            if not usedText[icon.data.Id][text] then
                tinsert(quest, data)
                usedText[icon.data.Id][text] = true
            end

The allows us to tag EACH objective and make it unique to that quest specifically without adding any duplicates.

commented

call me paranoid, but nil checks sound like a good idea...

commented

Nil checks on what?

commented

ecerything.. icon, usedText

commented

Go read the code and look through the stack yourself. You'll find that we don't need to do any additional nil checks in the _MapIconTooltip:AddTooltipsForQuest function. :D

commented

like i mentioned.. paranoid (too many race conditions on my potato)