benilla-re systems structs docs

Script::UnitName

function · ui · primitive

Address
0x517020 · 618 bytes, up to 0x517289
Signature
int __fastcall (lua_State *L)
Meaning
Pushes a unit's name and realm; for the string player it pushes the selected character's name and nil
Confidence
verified, proof one
Name from
the community database (idb)
Finding
ui/unitplayer#the-four-readers

Finding: The four readers in ui: the player token before the player object

UnitName, UnitSex, UnitRace and UnitClass compare their token with the whole string player (SStrCmpI, 0x7fffffff) and, on a match, answer from the record without the resolver or an object. UnitName pushes the name and then nil (two values; the realm slot is always nil here). UnitSex pushes {2, 3, 1, 6}[sex byte] from the table 0x808be4, with no bound. UnitRace and UnitClass push the localised name and the token of the ChrRaces or ChrClasses row of the byte, or nil, nil when the id is out of range or its row is missing. The record wins over the object for these four forever.

The derivation is in the doc.

Callers 0

None by a direct call or jump.

Callees 17

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