fix(Scripts/Temple of AhnQiraj): Qiraji Champion. (#12965)

This commit is contained in:
UltraNix
2022-09-28 05:40:50 +02:00
committed by GitHub
parent e00242d8f0
commit 6a4dbb7436
5 changed files with 65 additions and 4 deletions

View File

@@ -406,13 +406,16 @@ bool CreatureGroup::IsFormationInCombat()
return false;
}
bool CreatureGroup::IsAnyMemberAlive()
bool CreatureGroup::IsAnyMemberAlive(bool ignoreLeader /*= false*/)
{
for (auto const& itr : m_members)
{
if (itr.first && itr.first->IsAlive())
{
return true;
if (!ignoreLeader || itr.first != m_leader)
{
return true;
}
}
}

View File

@@ -111,7 +111,7 @@ public:
void MemberEvaded(Creature* member);
void RespawnFormation(bool force = false);
[[nodiscard]] bool IsFormationInCombat();
[[nodiscard]] bool IsAnyMemberAlive();
[[nodiscard]] bool IsAnyMemberAlive(bool ignoreLeader = false);
private:
Creature* m_leader; //Important do not forget sometimes to work with pointers instead synonims :D:D