View Single Post
Unread 12-20-12, 11:25 PM   #2
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,591
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.
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote