Fix quest title showing as NPC guild

When an NPC is part of a quest, tooltip line 2 might be the quest name or something else non-Guild-related. Fortunately each line has a type associated with it, so if it's not type None (0), don't treat it like a guild. I could check for types like QuestTitle (17) but since the tooltip lines can contain any arbitrary information, it's best to make sure it's what we want instead of making sure it's not something specific that we don't want.
This commit is contained in:
Parnic
2022-11-25 20:59:49 -06:00
parent 07d6c46c18
commit 2f07b4d995

View File

@ -72,6 +72,10 @@ local function FigureNPCGuild(unit)
if not left_2 or left_2:find(LEVEL_start) then
return nil
end
-- tooltips can contain any data, including quest info, so check for the type of the line before using it, if present
if Enum and Enum.TooltipDataLineType and info and info.lines[2] and info.lines[2].type ~= Enum.TooltipDataLineType.None then
return nil
end
return left_2
end