benilla-re systems structs docs

s_unitInteractRangeSq

global · ui

Address
0xb4b32c · 4 bytes, up to 0xb4b32f
Type
float
Meaning
Holds the squared distance past which a unit's cursor is the unable form
Confidence
verified, proof one
Finding
ui/worldcursor#units-charm-and-interaction

Finding: Units: charm and interaction in ui: the pointer picture

With the player's charm latch (bit 0 of +0x1c70) set, a hovered unit that is alive gets Attack (4) when the possessed unit (objectlayer/interaction#far-sight) exists, is neither dead nor mounted, and may attack it; anything else gets the base mode. There is no range test. Otherwise the unit's squared centre distance to the player is compared with 30.864 (5.5556 squared; equal counts as in range). If the unit can be interacted with (objectlayer/reaction#interacting-now), its NPC flags pick the mode, lowest bit first, and the unable form (+20) is used beyond that distance.

The derivation is in the doc.