Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
ZhengPeiRu21
2022-09-28 17:09:45 -06:00
committed by GitHub
17 changed files with 563 additions and 11 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