benilla-re systems structs docs

CanControlUnit

function · input · primitive

Address
0x5144e0 · 122 bytes, up to 0x514559
Meaning
Returns whether a unit can be driven: alive, not locked, not far-sighted
Confidence
verified, proof one
Finding
input#may-it-move-may-it-turn

Finding: May it move, may it turn in input

0x5144e0(unit) is the precondition of both: the unit exists, UNIT_FIELD_HEALTH is above 0 (signed), its movement object's auxiliary record (+0xa4) is absent or has bit 0x4 at +0x18, it is not in a current animation whose AnimationData word (column 3) has bit 0x80 (the knockdown lockout, 0x60f5b0), and it is not the active player with far sight engaged (+0x1c70 bit 0). 0x514560 adds that the movement flags (+0x40 of the movement object) have none of 0x1200 and the stand state is not 7. 0x5145b0 adds that UNIT_FIELD_FLAGS has bit 0x40000 clear. A dead unit therefore fails both: it neither moves nor turns.

The derivation is in the doc.

Callers 6

Callees 2

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