Is "UnitIsInMyGuild" a broken function? - WoWInterface
Thread Tools Display Modes
07-15-16, 12:37 AM   #1
A Flamescale Wyrmkin
siweia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 122
Is "UnitIsInMyGuild" a broken function?

It seems like "UnitIsInMyGuild" only checks for those players in your guild with the same realm.
It returns "false" whether you check their realm or not.

For example, your name is AAA-BBB, one of your guild members named CCC-DDD.
Both UnitIsInMyGuild("CCC") and UnitIsInMyGuild("CCC-DDD") would return false.

UnitInRaid and UnitInParty won't support realm info either.
Your name is AAA-BBB, your party member is CCC-DDD.
Both UnitInRaid("CCC") and UnitInRaid("CCC-DDD") return true.

The following code is what I am currently using to check my members.
local UnitInGuild = function(unit)
	for i = 1, GetNumGuildMembers() do
		local name = GetGuildRosterInfo(i)
		if name and name == unit then
			return true
	return false

Last edited by siweia : 07-15-16 at 12:39 AM.
07-15-16, 10:56 AM   #2
Fishing Trainer
Seerah's Avatar
WoWInterface Super Mod
Join Date: Oct 2006
Posts: 10,745
Did I miss when you can have a guild member on a different server?
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

07-15-16, 11:20 AM   #3
A Pyroguard Emberseer
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,059
Originally Posted by Seerah View Post
Did I miss when you can have a guild member on a different server?
Merged realms allow you to have players that are technically on a separate server in your guild.

I had to do something similar to this to mark guild members on their nameplates, but I think I just cached the entire guild roster in a table and referenced that.
07-18-16, 09:08 PM   #4
A Fallenroot Satyr
Bringer's Avatar
Join Date: Jul 2012
Posts: 26
Minor Correction - Connected Realms are actually all on the same server ID

WoWInterface » Site Forums » Archived Beta Forums » Legion Beta archived threads » Is "UnitIsInMyGuild" a broken function?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off