benilla-re systems structs docs

GetUnitFromToken

function · ui · orchestration

Address
0x515940 · 34 bytes, up to 0x515961
Signature
CGUnit_C * __fastcall (const char *token)
Meaning
Returns the unit object a token names, null for none
Confidence
verified, proof one
Finding
ui/unittokens#indexed-tokens

Finding: Indexed tokens in ui: unit tokens and the unit functions' arguments

For party, partypet, raid and raidpet the digits after the prefix are summed in base 10 with no cap (acc*10 + digit, wrapping at 32 bits), stopping at the first byte outside 0 to 9. The 1-based number is decremented, so a missing suffix gives index 0xffffffff. party takes indices below 4 from the GUID table 0xbc6f48 and 0 otherwise. raid and raidpet take indices below the raid count 0xb713e0 from the roster. partypet has no bound: it reads the table with the index as given, then the member record. A pet GUID is the owner's charm GUID when nonzero, else its summon GUID. 0x515940(token) returns the unit object of the GUID, null for GUID 0.

The derivation is in the doc.

Callers 49

Callees 2

Calls and jumps by a bare address, from tables/calls.tsv.