CGUnit_C::CanAttack
function · objectlayer · primitive
- Address
0x606980· 543 bytes, up to0x606b9e- Signature
bool __thiscall (CGUnit_C *this, CGUnit_C *other)- Meaning
- Returns whether a unit may attack another: the ghost, flag and cross-flag refusals, then the reaction arms
- Confidence
- verified, proof one
- Name from
- the community database (idb)
- Finding
- objectlayer/reaction#attacking
Finding: Attacking in objectlayer: reaction
0x606980(this = A, B) decides whether A may attack B. Only a creature with type flag 0x2 may
attack a ghost player, bit 4 of PLAYER_FLAGS. Bits 1, 7, 16, 20 and 25 of B's UNIT_FIELD_FLAGS
each refuse. Bits 8 and 9 refuse across the controlled line both ways: B's 0x100 against a
controlled A, B's 0x200 against any other, and A's against B alike. Two uncontrolled units may
fight when either reaction is 1 or less; a mixed pair when A's is below 4. Two
controlled units may not at 4 or more; else they may when a controlling player is missing, both
are in one duel, B's player has the PvP flag, bit 12, or both are free-for-all.
The derivation is in the doc.
Callers 20
- AdmitPickUnit ui
- CGWorldFrame::ClassifyHoveredUnit ui
- CGGameUI::SelectTarget ui
- CGGameUI::TargetKindAccepts ui
- Script::UnitCanAttack ui
- Script::UnitLevel ui
- CGTooltip::BuildUnit ui
- OnDrunkChanged objectlayer
- CGPlayer_C::StartMeleeAttack objectlayer
- ClassifyGuidForPlayer objectlayer
- CGUnit_C::GetSelectionColor objectlayer
- CGUnit_C::Update objectlayer
- CGUnit_C::Interact objectlayer
- CGUnit_C::UpdateNamePlateVisibility objectlayer
- CGUnit_C::CanStartMeleeAttack objectlayer
- IsSpellUsable spell
- CheckSpellTargetRange spell
- BindSpellTargetObject spell
- SpellCanTargetObject spell
- DisplayedLevel ui
Callees 3
- CGUnit_C::IsCreatureTypeFlagSpiritWorld objectlayer
- CGUnit_C::GetControllingPlayer objectlayer
- CGUnit_C::UnitReaction objectlayer
Calls and jumps by a bare address, from tables/calls.tsv.