benilla-re systems structs docs

Script::UnitRace

function · ui · orchestration

Address
0x518200 · 323 bytes, up to 0x518342
Signature
int __fastcall (lua_State *L)
Meaning
Pushes the localised race name and file token of a unit, or two nils
Confidence
verified, proof one
Name from
the community database (idb)
Finding
ui/unitplayer#race-and-class-of-other-units

Finding: Race and class of other units in ui: the player token before the player object

For any other token UnitRace and UnitClass read the byte of a held unit object ([[obj+0x110]+0x78] race, +0x79 class) and, for an unheld one, the name cache record's +0x138 and +0x140, queried with a null callback so no name request is sent. The same ChrRaces and ChrClasses lookup then gives the two values, or two nils on any miss. Both raise Usage: UnitRace("unit") and Usage: UnitClass("unit") for a nil or missing argument, before anything else; UnitRace("target") with no target gives nil, nil.

The derivation is in the doc.

Callers 0

None by a direct call or jump.

Callees 10

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