MCPcopy Create free account
hub / github.com/bwapi/bwapi / isAttacking

Method isAttacking

bwapi/BWAPI/Source/BW/CUnit.cpp:29–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 return this;
28 }
29 bool CUnit::isAttacking() const
30 {
31 BW::Anims::Enum animState = BW::Anims::Init;
32 const BW::CUnit* damageDealer = this->getDamageDealer();
33 if (damageDealer->sprite && damageDealer->sprite->pImagePrimary)
34 {
35 animState = damageDealer->sprite->pImagePrimary->anim;
36 }
37 return (animState == BW::Anims::GndAttkRpt || //isAttacking
38 animState == BW::Anims::AirAttkRpt ||
39 animState == BW::Anims::GndAttkInit ||
40 animState == BW::Anims::AirAttkInit) && this->orderTarget.pUnit != nullptr;
41 }
42 int CUnit::getGroundWeaponCooldown() const
43 {
44 const BWAPI::UnitType type = this->type();

Callers 2

updateDataMethod · 0.45
Filters.cppFile · 0.45

Calls 1

getDamageDealerMethod · 0.95

Tested by

no test coverage detected