Call as
addon.Platform:GetUnitIdentityObservation(unit, otherunit)
Available directly through addon; no dependency is needed.
What it does
Compare two exact unit tokens using UnitIsUnit after checking only the first token with UnitExists. A readable absent first unit returns false without comparing. Required missing, failed, restricted or malformed observations return nil with a reason. No second existence query, GUID lookup or inferred identity is added.
Arguments
| Name | Type | What it does |
|---|---|---|
self | RMPlatform | Rotation Master platform adapter (implicit with colon calls). |
unit | string | First exact unit token, checked for existence before comparison. |
otherunit | string | Second exact unit token, passed unchanged to UnitIsUnit. |
Returns
| 1 | boolean | nil | Readable unit equality, false for a known absent first unit, or nil when required observations are unavailable. |
|---|---|---|
| 2 | string | nil | Policy, token-validation or availability reason for a nil identity result. |
Editions
Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.
- Not available on that edition (the reason is in the tooltip)
- Only while Blizzard's deprecation fallbacks are on
| Game API | |||||
|---|---|---|---|---|---|
UnitExists | |||||
UnitIsUnit |
Secret values (Retail and Forever)
On Retail and Forever the game hands addons secret values. This helper checks what it reads (addon.Platform:CanReadValue) and returns nil with a reason such as restricted-value instead of a secret it cannot compare. Treat nil as unavailable, not as false.
Example
local same = addon.Platform:GetUnitIdentityObservation("targettarget", "player")
if same == nil then return nil end
return same -- the target is attacking youSource
Platform/unit_identity.lua, line 21. Read only in game; Duplicate makes an editable copy.
Platform.unit_identity.GetUnitIdentityObservation(self, unit, otherunit)
local policy=self:GetCombatDataPolicy()
if policy~='probe' and policy~='restricted' then return nil,'unsupported-policy' end
if not self:CanReadValue(unit) or not self:CanReadValue(otherunit) then return nil,'restricted-value' end
if type(unit)~='string' or unit=='' or type(otherunit)~='string' or otherunit=='' then return nil,'invalid-unit' end
if type(UnitExists)~='function' then return nil,'missing-api' end
local existsOk,exists=pcall(UnitExists,unit)
if not existsOk then return nil,'api-error' end
if not self:CanReadValue(exists) then return nil,'restricted-value' end
if exists==nil then return nil,'unit-data-unavailable' end
if type(exists)~='boolean' then return nil,'invalid-api-result' end
if not exists then return false end
if type(UnitIsUnit)~='function' then return nil,'missing-api' end
local ok,same=pcall(UnitIsUnit,unit,otherunit)
if not ok then return nil,'api-error' end
if not self:CanReadValue(same) then return nil,'restricted-value' end
if same==nil then return nil,'unit-identity-unavailable' end
if type(same)~='boolean' then return nil,'invalid-api-result' end
return same




