benilla-re systems structs docs

CGGameUI::CollectNearbyUnit

function · ui · primitive

Address
0x494200 · 580 bytes, up to 0x494443
Signature
uint32_t __thiscall (CGUnit_C *this, uint64_t guid)
Meaning
Adds a unit to the nearby list when its kind, distance, cone and creature type pass
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.

Callers 0

None by a direct call or jump.

Callees 8

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