Script::UnitCanAttack
function · ui · orchestration
- Address
0x516c50· 149 bytes, up to0x516ce4- Signature
int __fastcall (lua_State *L)- Meaning
- Pushes 1 when both units resolve and the first can attack the second, else nil
- Confidence
- verified, proof one
- Name from
- the community database (idb)
- Finding
- ui/unitinfo#player-corpse-and-attack-tests
Finding: Player, corpse and attack tests in ui: unit presence, flags, classification and type
UnitIsPlayer(unit) pushes 1 when the token's GUID has an object of type mask 0x10 (a player) or is a party or raid member by GUID (0x4918e0, members only, not pets), else nil; a party member out of range is a player to it.
UnitIsCorpse(unit) pushes 1 when the GUID has a corpse object (type mask 0x80), which a dead unit does not have. UnitCanAttack(unit, other) pushes 1 when both tokens resolve to unit objects (mask 8) and 0x606980(unit, other) holds.
The derivation is in the doc.
Callers 0
None by a direct call or jump.
Callees 7
- GetUnitFromToken ui
- CGUnit_C::CanAttack objectlayer
- lua_isstring lua
- lua_tostring lua
- lua_pushnil lua
- lua_pushnumber lua
- luaL_error lua
Calls and jumps by a bare address, from tables/calls.tsv.