From a6cf157518fe0969b77d4dea8e4c4ba0dc525670 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Sat, 25 Jul 2026 00:49:50 -0500 Subject: [PATCH] read spell rank via C_Spell.GetSpellSubtext The rank string comes from the spell subtext ("Rank N"), which ClassicAPI's C_Spell.GetSpellSubtext returns directly -- so drop nampower's GetSpellRecField(spellId, "rank") here. The existing "Rank " gsub parse is unchanged. --- libs/libdebuff.lua | 2 +- libs/libpredict.lua | 10 ++++------ modules/castbar.lua | 4 ++-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/libs/libdebuff.lua b/libs/libdebuff.lua index cd0da210..2fb3e79f 100644 --- a/libs/libdebuff.lua +++ b/libs/libdebuff.lua @@ -1125,7 +1125,7 @@ if hasNampower then -- Rank aus spellId ermitteln local rankNum = 0 - local rankString = GetSpellRecField(spellId, "rank") + local rankString = C_Spell.GetSpellSubtext(spellId) if rankString and rankString ~= "" then rankNum = tonumber((string.gsub(rankString, "Rank ", ""))) or 0 end diff --git a/libs/libpredict.lua b/libs/libpredict.lua index 7f42c96f..84b65b7f 100644 --- a/libs/libpredict.lua +++ b/libs/libpredict.lua @@ -291,7 +291,7 @@ pfUI.libdebuff_spell_start_other_hooks["libpredict"] = function(spellId, casterG local targetName = resolveNameFromGuid(targetGuid) if not targetName then return end - local rankStr = GetSpellRecField and GetSpellRecField(spellId, "rank") or "" + local rankStr = C_Spell.GetSpellSubtext(spellId) or "" local spellKey = spellName .. (rankStr or "") local amount = foreignCache[casterName] and foreignCache[casterName][spellKey] @@ -355,11 +355,9 @@ pfUI.libdebuff_spell_go_hooks["libpredict"] = function(spellId, a1, a2, a3, a4, elseif hotType == "Renew" then duration = renewDuration or 15 end local rank = 0 - if GetSpellRecField then - local rankStr = GetSpellRecField(spellId, "rank") - if rankStr and rankStr ~= "" then - rank = tonumber((string.gsub(rankStr, "Rank ", ""))) or 0 - end + local rankSub = C_Spell.GetSpellSubtext(spellId) + if rankSub and rankSub ~= "" then + rank = tonumber((string.gsub(rankSub, "Rank ", ""))) or 0 end local playerName = UnitName("player") libpredict:Hot(playerName, targetName, hotType, duration, nil, "SPELL_GO_SELF", rank) diff --git a/modules/castbar.lua b/modules/castbar.lua index ffbcaaf9..1c6acfc9 100644 --- a/modules/castbar.lua +++ b/modules/castbar.lua @@ -93,8 +93,8 @@ pfUI:RegisterModule("castbar", function () cb.bar:SetStatusBarColor(strsplit(",", C.appearance.castbar[isChannel and "channelcolor" or "castbarcolor"])) local rank = "" - if spellID and GetSpellRecField then - rank = GetSpellRecField(spellID, "rank") or "" + if spellID then + rank = C_Spell.GetSpellSubtext(spellID) or "" end local spellname = (cb.showname and name) and (name .. " ") or "" local rankstr = (cb.showrank and rank ~= "") and string.format("|cffaaffcc[%s]|r", rank) or ""