Thread Tools Display Modes
12-09-09, 06:11 PM   #1
Smacker
A Deviate Faerie Dragon
 
Smacker's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2009
Posts: 16
UnitIsPlayer and 3.3

Anyone else find that UnitIsPlayer(unit) always returns 1 in 3.3? Did I miss something?
  Reply With Quote
12-09-09, 06:20 PM   #2
wurmfood
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 122
Just tested it in Dalaran and it seems to work correctly.

Tested with:

/script DEFAULT_CHAT_FRAME:AddMessage(UnitIsPlayer"target")

For an NPC I got "nil", for a player I got "1".
  Reply With Quote
12-09-09, 09:09 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Yes, make sure you're targeting an NPC character, not a real-life player's character if you want a nil return.

If you wish to check to see if your target (or whatever unit) is the actual "player" unit, then you need to use UnitIsUnit("player", "target")
__________________
"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

  Reply With Quote
12-10-09, 05:35 AM   #4
Smacker
A Deviate Faerie Dragon
 
Smacker's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2009
Posts: 16
Thanks for the replies. I figured out what I was doing wrong!
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » UnitIsPlayer and 3.3


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