View Single Post
01-19-23, 01:49 AM   #18
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
UnitIsUnit() is expecting two units to compare equality. This is commonly used to check if a firing UNIT_* event is for a script's unitframe. We're already grabbing our unit from the buff frame, there's nothing to compare with here.

If you want to check if a unit exists, you need to use UnitExists(). Considering the hooked function doesn't even fire when the unit doesn't exist, this is also pointless.

This is the updated script without any filtering.

Lua Code:
  1. local function TargetFrame_UpdateAuras(self)
  2.     for buff in self.auraPools:GetPool("TargetBuffFrameTemplate"):EnumerateActive() do
  3.         local data=C_UnitAuras.GetAuraDataByAuraInstanceID(buff.unit,buff.auraInstanceID);
  4.         buff.Stealable:SetShown(data.isStealable or data.dispelName=="Magic");
  5.     end
  6. end
  7.  
  8. hooksecurefunc(TargetFrame,"UpdateAuras",TargetFrame_UpdateAuras);
  9. hooksecurefunc(FocusFrame,"UpdateAuras",TargetFrame_UpdateAuras);
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 01-19-23 at 05:08 AM.
  Reply With Quote