From a1295449d23ebea3a4dd70e1cd33acf386c25037 Mon Sep 17 00:00:00 2001 From: Bluewhale1337 <295648290+Bluewhale1337@users.noreply.github.com> Date: Mon, 27 Jul 2026 00:09:29 +0200 Subject: [PATCH] fix(tooltip): resolve global ID nil crash across all Tooltip functions --- ElvUI/Modules/Tooltip/Tooltip.lua | 72 +++++++++++++++---------------- README.md | 1 + 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/ElvUI/Modules/Tooltip/Tooltip.lua b/ElvUI/Modules/Tooltip/Tooltip.lua index 2cbaba7..0c77aec 100644 --- a/ElvUI/Modules/Tooltip/Tooltip.lua +++ b/ElvUI/Modules/Tooltip/Tooltip.lua @@ -273,7 +273,7 @@ function TT:SetItemRef(link) if find(link, "^item:") then if E.db.tooltip.spellID then local id = tonumber(match(link, "(%d+)")) - ItemRefTooltip:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + ItemRefTooltip:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end end ItemRefTooltip:Show() @@ -312,8 +312,8 @@ function TT:SetAction(tt, buttonID) self:SetPrice(tt, id, count) end - if E.db.tooltip.spellID then - tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + if E.db.tooltip.spellID and id then + tt:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end tt:Show() end @@ -329,8 +329,8 @@ function TT:SetAuctionItem(tt, type, index) self:SetPrice(tt, id, count) end - if E.db.tooltip.spellID then - tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + if E.db.tooltip.spellID and id then + tt:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end tt:Show() end @@ -346,8 +346,8 @@ function TT:SetAuctionSellItem(tt) self:SetPrice(tt, id, count) end - if E.db.tooltip.spellID then - tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + if E.db.tooltip.spellID and id then + tt:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end tt:Show() end @@ -362,8 +362,8 @@ function TT:SetBagItem(tt, bag, slot) local _, count = GetContainerItemInfo(bag, slot) self:SetPrice(tt, id, count) end - if E.db.tooltip.spellID then - tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + if E.db.tooltip.spellID and id then + tt:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end tt:Show() end @@ -382,8 +382,8 @@ function TT:SetCraftItem(tt, skill, slot) self:SetPrice(tt, id, count) end - if E.db.tooltip.spellID then - tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + if E.db.tooltip.spellID and id then + tt:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end tt:Show() end @@ -394,8 +394,8 @@ function TT:SetCraftSpell(tt, id) local id = tonumber(match(link, "enchant:(%d+)")) - if E.db.tooltip.spellID then - tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + if E.db.tooltip.spellID and id then + tt:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end tt:Show() end @@ -422,7 +422,7 @@ function TT:SetHyperlink(tt, link, count) if tt:GetName() == "GameTooltip" then if E.db.tooltip.spellID and id then - tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + tt:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end end @@ -440,8 +440,8 @@ function TT:SetInboxItem(tt, index, attachmentIndex) self:SetPrice(tt, id, count) end - if E.db.tooltip.spellID then - tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + if E.db.tooltip.spellID and id then + tt:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end tt:Show() end @@ -463,8 +463,8 @@ function TT:SetInventoryItem(tt, unit, slot) self:SetPrice(tt, id, count) end - if E.db.tooltip.spellID then - tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + if E.db.tooltip.spellID and id then + tt:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end tt:Show() end @@ -479,8 +479,8 @@ function TT:SetLootItem(tt, slot) local _, _, count = GetLootSlotInfo(slot) self:SetPrice(tt, id, count) end - if E.db.tooltip.spellID then - tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + if E.db.tooltip.spellID and id then + tt:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end tt:Show() end @@ -495,8 +495,8 @@ function TT:SetLootRollItem(tt, rollID) local _, _, count = GetLootRollItemInfo(rollID) self:SetPrice(tt, id, count) end - if E.db.tooltip.spellID then - tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + if E.db.tooltip.spellID and id then + tt:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end tt:Show() end @@ -511,8 +511,8 @@ function TT:SetMerchantItem(tt, slot) local _, _, _, count = GetMerchantItemInfo(slot) self:SetPrice(tt, id, count) end - if E.db.tooltip.spellID then - tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + if E.db.tooltip.spellID and id then + tt:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end tt:Show() end @@ -527,8 +527,8 @@ function TT:SetQuestItem(tt, type, slot) local _, _, count = GetQuestItemInfo(type, slot) self:SetPrice(tt, id, count) end - if E.db.tooltip.spellID then - tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + if E.db.tooltip.spellID and id then + tt:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end tt:Show() end @@ -543,8 +543,8 @@ function TT:SetQuestLogItem(tt, type, index) local _, _, count = GetQuestLogRewardInfo(index) self:SetPrice(tt, id, count) end - if E.db.tooltip.spellID then - tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + if E.db.tooltip.spellID and id then + tt:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end tt:Show() end @@ -560,8 +560,8 @@ function TT:SetSendMailItem(tt, index) self:SetPrice(tt, id, count) end - if E.db.tooltip.spellID then - tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + if E.db.tooltip.spellID and id then + tt:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end tt:Show() end @@ -577,8 +577,8 @@ function TT:SetTradePlayerItem(tt, index) self:SetPrice(tt, id, count) end - if E.db.tooltip.spellID then - tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + if E.db.tooltip.spellID and id then + tt:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end tt:Show() end @@ -599,8 +599,8 @@ function TT:SetTradeSkillItem(tt, skill, slot) self:SetPrice(tt, id, count) end - if E.db.tooltip.spellID then - tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + if E.db.tooltip.spellID and id then + tt:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end tt:Show() end @@ -616,8 +616,8 @@ function TT:SetTradeTargetItem(tt, index) self:SetPrice(tt, id, count) end - if E.db.tooltip.spellID then - tt:AddLine(format("|cFFCA3C3C%s|r %d", ID, id)) + if E.db.tooltip.spellID and id then + tt:AddLine(format("|cFFCA3C3C%s|r %d", (ID or "ID"), id)) end tt:Show() end diff --git a/README.md b/README.md index a8052dc..63537bd 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ # This repository is actively being fixed and maintained by Bluewhale. ## Changelog +- **Fix:** Fixed global ID Lua 5.0 varargs crash across all Tooltip functions. - **Fix:** Fixed a Lua 5.0 syntax error in `AceConfigDialog-3.0.lua` where the `#` length operator was used instead of `table.getn`, preventing ElvUI_Config from loading. - **Fix:** Fixed nil ID formatting crash in Tooltip's SetHyperlink. - **Fix:** Removed implicit `arg` table memory leaks in high-frequency oUF element updates by replacing varargs (`...`) with static parameters.