CGWorldFrame::ClassifyHoveredUnit
function · ui · primitive
- Address
0x482200· 1241 bytes, up to0x4826d8- Signature
void __thiscall (CGWorldFrame *this, CGUnit_C *unit)- Meaning
- Sets the cursor mode for a hovered unit from its flags, state and distance
- Confidence
- verified, proof one
- Finding
- ui/worldcursor#units-charm-and-interaction
- Test
ui::textglue_482_normalize3,ui::textglue_482_sq_len3_482200,ui::textglue_482_square_cmp
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.
Callers 1
Callees 16
- EventIsKeyDown core
- ClntObjMgrObjectPtr objectlayer
- ClntObjMgrGetActivePlayer objectlayer
- SubtractVector3 ui
- SetCursorMode ui
- ShowBaseCursor ui
- IsQuestGiverToTalk objectlayer
- CGPlayer_C::CanLootNow objectlayer
- CGPlayer_C::GetPossessedFarSightUnit objectlayer
- CGPlayer_C::GetFactionSide objectlayer
- CGUnit_C::IsLootable objectlayer
- IsDeadOrGhost objectlayer
- CGUnit_C::CanAssist_Unit objectlayer
- CGUnit_C::CanInteractNow objectlayer
- CGUnit_C::CanAttack objectlayer
- Spell_C::GetMinMaxRange spell
Calls and jumps by a bare address, from tables/calls.tsv.