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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user