CanControlUnit
function · input · primitive
- Address
0x5144e0· 122 bytes, up to0x514559- 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
- MayTranslate input
- MayTurn input
- CGUnit_C::AutoMoveStart objectlayer
- CGUnit_C::AutoMoveStop objectlayer
- CGUnit_C::InputSetPitch objectlayer
- CGUnit_C::InputSetWorldFacing objectlayer
Callees 2
- IsActivePlayerUnit objectlayer
- CGUnit_C::IsCurrentAnimationFlag80 objectlayer
Calls and jumps by a bare address, from tables/calls.tsv.