Tooltip: don't crash on tooltips longer than 30 lines

AddSourceLine's line buffer is pre-built for exactly 30 entries, so any
item tooltip that exceeds that dies with

  Core\Tooltip.lua:56: attempt to index field '?' (a nil value)

on every hover, and the source line is never added. Easy to hit on
servers with long set lists in the tooltip plus a tooltip-extending
addon (StatCompare and friends) -- a 6-piece set block alone adds ~10
lines. Grow the buffer on demand instead; the clear/rebuild loops
already iterate whatever size the table has.
This commit is contained in:
roby-brok
2026-08-14 10:09:35 +01:00
committed by Spit
parent b0f7f3bf44
commit 1ad4c1e2a6
+3
View File
@@ -47,6 +47,9 @@ local function AddSourceLine(tooltip, sourceStr)
end
for i = 1, numLines do
-- the buffer is pre-built for 30 lines, but long set tooltips plus
-- tooltip-extending addons (StatCompare etc.) can exceed that
lines[i] = lines[i] or {}
left = _G[name.."TextLeft"..i]
right = _G[name.."TextRight"..i]
leftText = left:GetText()