Thread Tools Display Modes
10-04-18, 01:33 PM   #1
stako
A Deviate Faerie Dragon
 
stako's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 11
Unit Existence: UnitExists vs UnitGUID

Having a look at the Blizzard_ArenaUI addon, there's a line to check for the existence of a unit:
Lua Code:
  1. if ( UnitGUID(self.unit) ) then --Use UnitGUID instead of UnitExists in case the unit is a remote update.

What does it mean by 'remote update' here and what's the difference between using UnitExists and UnitGUID when checking for the existence of a unit?
  Reply With Quote
10-04-18, 02:10 PM   #2
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
UnitGUID requires the unit to actually be in the game, while UnitExists could be someone in the game or merely in remote chat. At least that's how I would interpret the intent. Also, UnitExists can sometimes fail when the player is in a loading screen, ie:// between worlds, whereas UnitGUID is assigned upon first logon and never changes until logout/exit.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Unit Existence: UnitExists vs UnitGUID

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