View Single Post
09-02-14, 06:02 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Also, this isn't related to whatever problem you're having, but:

Code:
if (... and IsInGuild() ~= nil) then
You should omit the explicit check against nil. In WoD all 1/nil returns are being changed to proper true/false booleans, and nil evaluates to a boolean false anyway, so a simpler implicit boolean check will not only be more readable and more efficient, but also work in both API environments:

Code:
if ... and IsInGuild() then
I'd also suggest moving the IsInGuild check inside the event check, so that if the event fires when you're not in a guild, your code won't waste time checking all the other events. Better yet, don't register the event at all if the player isn't in a guild.
__________________
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