diff --git a/libs/libdebuff.lua b/libs/libdebuff.lua index 25a0d8dd..bd20f0d1 100644 --- a/libs/libdebuff.lua +++ b/libs/libdebuff.lua @@ -424,7 +424,7 @@ local dispelTypeMap = { -- Get current debuff state directly from WoW via GetUnitField -- Returns: { [displaySlot] = {auraSlot, spellId, spellName, stacks, texture, dtype} } local function GetDebuffSlotMap(guid) - if not guid or not GetUnitField or not SpellInfo then + if not guid or not GetUnitField then return nil end @@ -1275,9 +1275,13 @@ if hasNampower then end if numMissed > 0 or numHit == 0 then return end - if not SpellInfo then return end - - local spellName, spellRankString = SpellInfo(spellId) + + local spellName, spellRankString + if SpellInfo then + spellName, spellRankString = SpellInfo(spellId) + elseif GetSpellRecField then + spellName = GetSpellRecField(spellId, "name") + end if not spellName then return end local castRank = 0 @@ -1411,10 +1415,10 @@ if hasNampower then local durationMs = arg8 local auraCapStatus = arg9 - if not SpellInfo or not spellId then return end + if not spellId then return end if not targetGuid or targetGuid == "" or targetGuid == "0x0000000000000000" then return end - local spellName = SpellInfo(spellId) + local spellName = SpellInfo and SpellInfo(spellId) or (GetSpellRecField and GetSpellRecField(spellId, "name")) if not spellName then return end -- Deduplicate: Ignore if we processed this exact cast recently (within 100ms) diff --git a/modules/nameplates.lua b/modules/nameplates.lua index c807a1f5..0a167028 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -12,12 +12,6 @@ pfUI:RegisterModule("nameplates", "vanilla", function () end end - -- Check for SuperWoW support (fallback) - local hasSuperwow = SUPERWOW_VERSION ~= nil - - -- Use either Nampower or SuperWoW for GetName(1) GUID support - local superwow_active = hasNampower or hasSuperwow - -- Local function references for performance local GetTime = GetTime local UnitExists = UnitExists @@ -947,7 +941,7 @@ nameplates:RegisterEvent("ZONE_CHANGED_NEW_AREA") local font_size = C.nameplates.use_unitfonts == "1" and C.global.font_unit_size or C.global.font_size -- use superwow unit guid as unitstr if possible - if superwow_active and not unitstr then + if hasNampower and not unitstr then unitstr = plate.parent:GetName(1) end @@ -998,7 +992,7 @@ nameplates:RegisterEvent("ZONE_CHANGED_NEW_AREA") end -- target indicator - if superwow_active and cfg.outcombatstate then + if hasNampower and cfg.outcombatstate then local guid = plate.parent:GetName(1) or "" -- determine color based on combat state @@ -1088,7 +1082,7 @@ nameplates:RegisterEvent("ZONE_CHANGED_NEW_AREA") local rhp, rhpmax, estimated -- Try Nampower first for real HP values via GUID - local guid = superwow_active and plate.parent:GetName(1) or nil + local guid = hasNampower and plate.parent:GetName(1) or nil if guid and GetUnitField then local npHp = GetUnitField(guid, "health") local npMaxHp = GetUnitField(guid, "maxHealth") @@ -1138,11 +1132,11 @@ nameplates:RegisterEvent("ZONE_CHANGED_NEW_AREA") r, g, b, a = RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b, 1 end - if superwow_active and unitstr and UnitIsTapped(unitstr) and not UnitIsTappedByPlayer(unitstr) then + if hasNampower and unitstr and UnitIsTapped(unitstr) and not UnitIsTappedByPlayer(unitstr) then r, g, b, a = .5, .5, .5, .8 end - if superwow_active and cfg.barcombatstate then + if hasNampower and cfg.barcombatstate then local guid = plate.parent:GetName(1) or "" local color = GetCombatStateColor(guid) @@ -1249,7 +1243,7 @@ nameplates:RegisterEvent("ZONE_CHANGED_NEW_AREA") local nameplate = frame.nameplate -- Register GUID when plate becomes visible - if superwow_active then + if hasNampower then local guid = frame:GetName(1) if guid then nameplate.cachedGuid = guid @@ -1265,7 +1259,7 @@ nameplates:RegisterEvent("ZONE_CHANGED_NEW_AREA") local now = state and state.now or GetTime() -- Update GUID registry (lightweight, needed for event routing) - if superwow_active then + if hasNampower then local guid = frame:GetName(1) if guid and guid ~= nameplate.cachedGuid then if nameplate.cachedGuid and guidRegistry[nameplate.cachedGuid] == frame then @@ -1397,7 +1391,7 @@ nameplates:RegisterEvent("ZONE_CHANGED_NEW_AREA") -- trigger update when name color changed (includes combat state check) local r, g, b = original.name:GetTextColor() local inCombatWithPlayer = false - if superwow_active and cfg.namefightcolor then + if hasNampower and cfg.namefightcolor then local guid = nameplate.cachedGuid if guid then inCombatWithPlayer = UnitAffectingCombat(guid) and UnitAffectingCombat("player")