From 6418359865b3faf853d0bd79f9607f65bad32ca3 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Mon, 22 Jun 2026 19:00:58 -0500 Subject: [PATCH] use IsPlayerGuid from classicapi --- .../MikCombatEventHelper.lua | 34 +++++++------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/MikScrollingBattleText/MikCombatEventHelper.lua b/MikScrollingBattleText/MikCombatEventHelper.lua index f3ff209..3d25ad2 100644 --- a/MikScrollingBattleText/MikCombatEventHelper.lua +++ b/MikScrollingBattleText/MikCombatEventHelper.lua @@ -755,14 +755,6 @@ local function GetNameFromGUID(guid) end --- ********************************************************************************** --- Checks if the given GUID belongs to the player. --- ********************************************************************************** -local function IsPlayerGUID(guid) - return playerGUID and guid == playerGUID -end - - -- ********************************************************************************** -- Checks if the given GUID belongs to the player's pet. -- ********************************************************************************** @@ -861,8 +853,8 @@ nampowerHandlers["SPELL_DAMAGE_EVENT_SELF"] = function() -- Special case: if the player is both caster and target (e.g. Hellfire self-damage, -- spell reflects), route as incoming since the player is taking damage. local directionType - if IsPlayerGUID(casterGuid) then - if IsPlayerGUID(targetGuid) then + if IsPlayerGuid(casterGuid) then + if IsPlayerGuid(targetGuid) then directionType = MikCEH.DIRECTIONTYPE_PLAYER_INCOMING else directionType = MikCEH.DIRECTIONTYPE_PLAYER_OUTGOING @@ -922,7 +914,7 @@ nampowerHandlers["SPELL_DAMAGE_EVENT_OTHER"] = function() -- Only process if target is player or pet. local directionType - if IsPlayerGUID(targetGuid) then + if IsPlayerGuid(targetGuid) then directionType = MikCEH.DIRECTIONTYPE_PLAYER_INCOMING elseif IsPetGUID(targetGuid) then directionType = MikCEH.DIRECTIONTYPE_PET_INCOMING @@ -975,7 +967,7 @@ nampowerHandlers["AUTO_ATTACK_SELF"] = function() local resistedDmg = arg9 or 0 local directionType - if IsPlayerGUID(casterGuid) then + if IsPlayerGuid(casterGuid) then directionType = MikCEH.DIRECTIONTYPE_PLAYER_OUTGOING nampowerAutoAttackActive = true elseif IsPetGUID(casterGuid) then @@ -1047,7 +1039,7 @@ nampowerHandlers["AUTO_ATTACK_OTHER"] = function() local resistedDmg = arg9 or 0 local directionType - if IsPlayerGUID(targetGuid) then + if IsPlayerGuid(targetGuid) then directionType = MikCEH.DIRECTIONTYPE_PLAYER_INCOMING nampowerAutoAttackActive = true elseif IsPetGUID(targetGuid) then @@ -1111,7 +1103,7 @@ nampowerHandlers["SPELL_HEAL_ON_SELF"] = function() local isHot = arg6 -- Only for player. - if not IsPlayerGUID(targetGuid) then return end + if not IsPlayerGuid(targetGuid) then return end -- Only disable CHAT_MSG fallback after we've confirmed playerGUID works. nampowerHealsActive = true @@ -1154,7 +1146,7 @@ nampowerHandlers["SPELL_HEAL_BY_SELF"] = function() -- When playerGUID is nil, we can't identify self-heals, so bail out -- and let the CHAT_MSG fallback handle it. if not playerGUID then return end - if IsPlayerGUID(targetGuid) then return end + if IsPlayerGuid(targetGuid) then return end -- Only disable CHAT_MSG fallback after we've confirmed playerGUID works. nampowerHealsActive = true @@ -1215,7 +1207,7 @@ nampowerHandlers["SPELL_MISS_SELF"] = function() local missInfo = arg4 local directionType - if IsPlayerGUID(casterGuid) then + if IsPlayerGuid(casterGuid) then directionType = MikCEH.DIRECTIONTYPE_PLAYER_OUTGOING nampowerSpellDamageActive = true elseif IsPetGUID(casterGuid) then @@ -1247,7 +1239,7 @@ nampowerHandlers["SPELL_MISS_OTHER"] = function() -- Only process if target is player or pet. local directionType - if IsPlayerGUID(targetGuid) then + if IsPlayerGuid(targetGuid) then directionType = MikCEH.DIRECTIONTYPE_PLAYER_INCOMING elseif IsPetGUID(targetGuid) then directionType = MikCEH.DIRECTIONTYPE_PET_INCOMING @@ -1276,7 +1268,7 @@ nampowerHandlers["BUFF_ADDED_SELF"] = function() local state = arg7 -- Only for player. - if not IsPlayerGUID(unitGuid) then return end + if not IsPlayerGuid(unitGuid) then return end nampowerBuffsActive = true @@ -1303,7 +1295,7 @@ nampowerHandlers["DEBUFF_ADDED_SELF"] = function() local state = arg7 -- Only for player. - if not IsPlayerGUID(unitGuid) then return end + if not IsPlayerGuid(unitGuid) then return end nampowerBuffsActive = true @@ -1329,7 +1321,7 @@ nampowerHandlers["BUFF_REMOVED_SELF"] = function() local spellId = arg3 -- Only for player. - if not IsPlayerGUID(unitGuid) then return end + if not IsPlayerGuid(unitGuid) then return end local spellName = GetSpellNameFromId(spellId) if not spellName then return end @@ -1350,7 +1342,7 @@ nampowerHandlers["DEBUFF_REMOVED_SELF"] = function() local spellId = arg3 -- Only for player. - if not IsPlayerGUID(unitGuid) then return end + if not IsPlayerGuid(unitGuid) then return end local spellName = GetSpellNameFromId(spellId) if not spellName then return end