benilla-re systems structs docs

CGUnit_C::GetControllingPlayer

function · objectlayer · primitive

Address
0x606170 · 103 bytes, up to 0x6061d6
Signature
CGPlayer_C * __thiscall (CGUnit_C *this)
Meaning
Returns the unit its charmer or else creator names, or itself, when that is a player; else null
Confidence
verified, proof one
Name from
the community database (idb)
Finding
objectlayer/reaction#controlling-player-and-reputation-slot

Finding: Controlling player and reputation slot in objectlayer: reaction

0x606170(unit) gives the player that controls a unit: the unit named by its charmer, field 10, or else its creator, field 14, or the unit itself when both are zero; the result counts only when its type mask has the player bit, else 0. 0x605fc0(faction) is true when the faction's Faction.dbc row exists and its reputation index, +0x4, is not negative.

The derivation is in the doc.

Callers 10

Callees 1

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