diff --git a/TPerl/TPerl.lua b/TPerl/TPerl.lua index b988381..ba5529c 100644 --- a/TPerl/TPerl.lua +++ b/TPerl/TPerl.lua @@ -4106,13 +4106,14 @@ local function AuraButtonOnShow(self) cd.countdown:SetTextColor(1, 1, 0) end - local duration, expirationTime, sourceUnit + local duration, expirationTime, sourceUnit, isFromPlayerOrPlayerPet if not IsVanillaClassic and C_UnitAuras then local auraData = TPerl_SafeGetAuraDataByIndex("player", self.xindex, self.xfilter) if auraData then duration = TPerl_SafeTableGet(auraData, "duration") expirationTime = TPerl_SafeTableGet(auraData, "expirationTime") sourceUnit = TPerl_SafeTableGet(auraData, "sourceUnit") + isFromPlayerOrPlayerPet = TPerl_SafeTableGet(auraData, "isFromPlayerOrPlayerPet") end else local _ @@ -4121,7 +4122,16 @@ local function AuraButtonOnShow(self) if duration and expirationTime then local start = expirationTime - duration - TPerl_CooldownFrame_SetTimer(self.cooldown, start, duration, 1, sourceUnit == "player") + -- sourceUnit may be a secret (tainted) value in Midnight/Retail; compare safely. + local isPlayerSource + if isFromPlayerOrPlayerPet ~= nil and TPerl_CanAccess(isFromPlayerOrPlayerPet) then + isPlayerSource = isFromPlayerOrPlayerPet and true or false + elseif TPerl_CanAccess(sourceUnit) then + isPlayerSource = (sourceUnit == "player") + else + isPlayerSource = false + end + TPerl_CooldownFrame_SetTimer(self.cooldown, start, duration, 1, isPlayerSource) end end