Quantcast WoWInterface - View Single Post - UnitInParty(name)
View Single Post
12-20-12, 11:25 PM   #2
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,616
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:

if destGUID == UnitGUID("player") or UnitClass(name) then
    -- code
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, oUF_Phanx, 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!
  Reply With Quote