API:UnitIsUnit

__NOTOC__
UnitIsUnit
Determines whether two given units refer to one and the same unit.
UnitIsUnit(UnitId1, UnitId2);
== Parameters ==
=== Arguments ===
:;UnitId1
::string - The first UnitId.
:;UnitId2
::string - The second UnitId.
=== Returns ===
:;boolean
::Boolean value - true if both UnitId refer to the same unit, false otherwise.
:::nil will be returned if the target UnitId does not exist (see Example 2).
== Example ==
-- Example 1:
if ( UnitIsUnit( "player", "target" ) ) then
 SendChatMessage("I look good!", "SAY" );
end
-- Example 2: Do not implement it like hereunder, because it will not pass the test if the UnitId you gave does not exist;
-- In the example, the condition has to be read as:
-- "if target is targeting something, but not the player"
-- not as:
-- "if target is not targeting player".
if ( UnitIsUnit("player", "targettarget") == false) then
 SendChatMessage("I look good!", "SAY" ); -- will not be run if target is not targeting anyone.
end