Talk:API UnitName

From Warcraft Wiki
Jump to navigation Jump to search

Does not return realm

Seems that this function no longer returns the realm and only returns the name. Have to use GetRealmName() to get realm. Can someone confirm this? --Vinaur 7:38, 02 Jan 2007

It works fine, just tested it. It has two cases where it doesn't return realm however, one is when they are from the same realm as you, and the other is when they are more then 100 yards away from you. -- Shadow 12:49, 3 January 2007 (EST)

nil Return Changed in the Last Patch (2.2)

UnitName("target"), UnitName("focus"), UnitName("raid#"), UnitName("party#"), etc... no longer return nil when the unit doesn't exist, it returns "Unknown" --Thoughtlover 04:06, 28 September 2007 (UTC)

Bug Fixed in 2.3

During 2.2, UnitName was bugged. UnitName returned "Unknown" if not applicable, or nil if the unit code itself is invalid (such as "xyz"). This was fixed in 2.3. ([1]) Thoughtlover 20:00, 19 December 2007 (UTC)