View Single Post
12-20-12, 11:25 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
If you just want to check if they're in your group, you can use any UnitWhatever function; all of those functions will return nil if called with a name (instead of a unitID) that doesn't belong to someone in your group. eg. this will work the same way:

Code:
if destGUID == UnitGUID("player") or UnitClass(name) then
    -- code
end
Also, looking up UnitGUID("player") on every combat log is extremely inefficient. Look it up once when PLAYER_LOGIN fires (you're probably already doing other initialization stuff there) and store it in a file-level local variable, and compare the destGUID against that.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote