benilla-re systems structs docs

s_cvarTargetNearestDistance

global · ui

Address
0xb4e2a8 · 4 bytes, up to 0xb4e2ab
Type
void *
Meaning
Points to the targetNearestDistance record, default 41
Confidence
verified, proof one
Finding
ui/targeting#collecting-the-candidates

Finding: Collecting the candidates in ui: selecting a target

The collector 0x494200 runs for every object. It keeps a unit that passes the cached kind's filter, is drawn, and lies within a distance of the player: targetNearestDistance (default 41) when it is in front, targetNearestDistanceRadius (default 10) when it is not. In front is a heading from the player to the unit within 30 degrees of the player's facing, either side. The record stored is the GUID, the squared distance as a float, and the in-front flag. Units of a creature type whose record has bit 0 of +0x28 set are skipped. The sort puts in-front units first and then ascending distance. Both options must lie between 1 and 50.

The derivation is in the doc.