mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 06:06:23 +00:00
revert "fix(Core/Formations): Implemented new creature formation flag: GROUP_AI_FLAG_ACQUIRE_NEW_TARGET_ON_EVADE." (#14494)
This commit is contained in:
@@ -200,72 +200,32 @@ void CreatureGroup::MemberEngagingTarget(Creature* member, Unit* target)
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!(groupAI & std::underlying_type_t<GroupAIFlags>(GroupAIFlags::GROUP_AI_FLAG_LEADER_ASSIST_MEMBER)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto const& itr : m_members)
|
||||
{
|
||||
Creature* pMember = itr.first;
|
||||
if (!pMember)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (m_leader) // avoid crash if leader was killed and reset.
|
||||
LOG_DEBUG("entities.unit", "GROUP ATTACK: group instance id {} calls member instid {}", m_leader->GetInstanceId(), member->GetInstanceId());
|
||||
|
||||
if (pMember == member || !pMember->IsAlive() || pMember->GetVictim())
|
||||
{
|
||||
//Skip one check
|
||||
if (pMember == member)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pMember == m_leader && !(groupAI & std::underlying_type_t<GroupAIFlags>(GroupAIFlags::GROUP_AI_FLAG_LEADER_ASSIST_MEMBER)))
|
||||
{
|
||||
if (!pMember->IsAlive())
|
||||
continue;
|
||||
|
||||
if (pMember->GetVictim())
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pMember->IsValidAttackTarget(target) && pMember->AI())
|
||||
{
|
||||
pMember->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Unit* CreatureGroup::GetNewTargetForMember(Creature* member)
|
||||
{
|
||||
uint8 const groupAI = sFormationMgr->CreatureGroupMap[member->GetSpawnId()].groupAI;
|
||||
if (!(groupAI & std::underlying_type_t<GroupAIFlags>(GroupAIFlags::GROUP_AI_FLAG_ACQUIRE_NEW_TARGET_ON_EVADE)))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (member == m_leader && !(groupAI & std::underlying_type_t<GroupAIFlags>(GroupAIFlags::GROUP_AI_FLAG_LEADER_ASSIST_MEMBER)))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (auto const& itr : m_members)
|
||||
{
|
||||
Creature* pMember = itr.first;
|
||||
if (!pMember)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pMember == member || !pMember->IsAlive() || !pMember->GetVictim())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pMember == m_leader && !(groupAI & std::underlying_type_t<GroupAIFlags>(GroupAIFlags::GROUP_AI_FLAG_MEMBER_ASSIST_LEADER)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (member->IsValidAttackTarget(pMember->GetVictim()))
|
||||
{
|
||||
return pMember->GetVictim();
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void CreatureGroup::MemberEvaded(Creature* member)
|
||||
{
|
||||
uint8 const groupAI = sFormationMgr->CreatureGroupMap[member->GetSpawnId()].groupAI;
|
||||
|
||||
Reference in New Issue
Block a user