diff --git a/EventListener.lua b/EventListener.lua index 9a2692d..bfa9354 100644 --- a/EventListener.lua +++ b/EventListener.lua @@ -112,7 +112,9 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED() end -- death detection if (Gladdy.buttons[destUnit] and eventType == "UNIT_DIED" or eventType == "PARTY_KILL" or eventType == "SPELL_INSTAKILL") then - Gladdy:SendMessage("UNIT_DEATH", destUnit) + if not Gladdy:isFeignDeath(destUnit) then + Gladdy:SendMessage("UNIT_DEATH", destUnit) + end end -- spec detection if Gladdy.buttons[destUnit] and (not Gladdy.buttons[destUnit].class or not Gladdy.buttons[destUnit].race) then diff --git a/Modules/Healthbar.lua b/Modules/Healthbar.lua index 9e06a9e..8a0d289 100644 --- a/Modules/Healthbar.lua +++ b/Modules/Healthbar.lua @@ -118,7 +118,7 @@ function Healthbar:CreateFrame(unit) end function Healthbar.OnEvent(self, event, unit) - local isDead = UnitExists(unit) and UnitIsDeadOrGhost(unit) + local isDead = UnitExists(unit) and UnitIsDeadOrGhost(unit) and not Gladdy:isFeignDeath(unit) if event == "UNIT_HEALTH_FREQUENT" or event == "UNIT_MAXHEALTH" then if isDead then Gladdy:SendMessage("UNIT_DEATH", unit) @@ -207,7 +207,7 @@ function Healthbar:SetHealthText(healthBar, health, healthMax) local healthText = "" local healthPercentage = health and healthMax and floor(health * 100 / healthMax) - if health == 0 and UnitExists(healthBar.unit) and UnitIsDeadOrGhost(healthBar.unit) then + if health == 0 and UnitExists(healthBar.unit) and UnitIsDeadOrGhost(healthBar.unit) and not Gladdy:isFeignDeath(healthBar.unit) then self:UNIT_DEATH(healthBar.unit) return end diff --git a/Util.lua b/Util.lua index 204ab05..94611f0 100644 --- a/Util.lua +++ b/Util.lua @@ -3,6 +3,8 @@ local floor = math.floor local str_find, str_gsub, str_sub, tinsert = string.find, string.gsub, string.sub, table.insert local Gladdy = LibStub("Gladdy") local L = Gladdy.L +local AuraUtil = AuraUtil +local GetSpellInfo = GetSpellInfo --------------------------- @@ -151,3 +153,8 @@ function Gladdy:contains(entry, list) end return false end + +local feignDeath = GetSpellInfo(5384) +function Gladdy:isFeignDeath(unit) + return AuraUtil.FindAuraByName(feignDeath, unit) +end