Fix stale trade skill indices in ATSW tooltips

This commit is contained in:
2026-10-02 19:50:38 +00:00
parent 51cc379ecf
commit 761a48fea4
+27 -1
View File
@@ -1401,7 +1401,29 @@ end
ATSW_TEST = 9000 ATSW_TEST = 9000
function ATSW_TooltipSetSkill(Tooltip, Index) function ATSW_TooltipSetSkill(Tooltip, Index)
if not Tooltip or not Index then
return
end
Index = tonumber(Index)
if not Index or Index < 1 then
return
end
if ATSW_TradeSkill() then if ATSW_TradeSkill() then
local NumSkills = GetNumTradeSkills()
if Index > NumSkills then
return
end
local Name, SkillType = GetTradeSkillInfo(Index)
if not Name or SkillType == 'header' then
return
end
Tooltip:SetTradeSkillItem(Index) Tooltip:SetTradeSkillItem(Index)
else else
Tooltip:SetCraftSpell(Index) Tooltip:SetCraftSpell(Index)
@@ -5797,7 +5819,11 @@ function ATSW_ShowRecipeTooltip()
ATSWRecipeItemTooltip:SetOwner(this, 'ANCHOR_BOTTOMRIGHT') ATSWRecipeItemTooltip:SetOwner(this, 'ANCHOR_BOTTOMRIGHT')
ATSW_TooltipSetSkill(ATSWRecipeItemTooltip, this.Position) local LivePosition = GetPositionFromGame(R.Name)
if LivePosition then
ATSW_TooltipSetSkill(ATSWRecipeItemTooltip, LivePosition)
end
ATSWRecipeItemTooltipTextLeft1:SetText(' ') ATSWRecipeItemTooltipTextLeft1:SetText(' ')
ATSWRecipeItemTooltip:Show() ATSWRecipeItemTooltip:Show()