mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-16 05:55:07 +00:00
refactor(Core): Clean-up after FD (#8586)
This commit is contained in:
@@ -57,9 +57,6 @@ bool PetAI::_needToStop()
|
||||
if (owner->GetExactDist(me) >= (owner->GetVisibilityRange() - 10.0f))
|
||||
return true;
|
||||
|
||||
if (!me->_CanDetectFeignDeathOf(me->GetVictim()))
|
||||
return true;
|
||||
|
||||
return !me->CanCreatureAttack(me->GetVictim());
|
||||
}
|
||||
|
||||
@@ -472,7 +469,7 @@ Unit* PetAI::SelectNextTarget(bool allowAutoSelect) const
|
||||
|
||||
// Check pet attackers first so we don't drag a bunch of targets to the owner
|
||||
if (Unit* myAttacker = me->getAttackerForHelper())
|
||||
if (!myAttacker->HasBreakableByDamageCrowdControlAura() && me->_CanDetectFeignDeathOf(myAttacker) && me->CanCreatureAttack(myAttacker))
|
||||
if (!myAttacker->HasBreakableByDamageCrowdControlAura() && me->CanCreatureAttack(myAttacker))
|
||||
return myAttacker;
|
||||
|
||||
// Check pet's attackers first to prevent dragging mobs back to owner
|
||||
@@ -482,7 +479,7 @@ Unit* PetAI::SelectNextTarget(bool allowAutoSelect) const
|
||||
if (!tauntAuras.empty())
|
||||
for (Unit::AuraEffectList::const_reverse_iterator itr = tauntAuras.rbegin(); itr != tauntAuras.rend(); ++itr)
|
||||
if (Unit* caster = (*itr)->GetCaster())
|
||||
if (me->_CanDetectFeignDeathOf(caster) && me->CanCreatureAttack(caster) && !caster->HasAuraTypeWithCaster(SPELL_AURA_IGNORED, me->GetGUID()))
|
||||
if (me->CanCreatureAttack(caster) && !caster->HasAuraTypeWithCaster(SPELL_AURA_IGNORED, me->GetGUID()))
|
||||
return caster;
|
||||
}
|
||||
|
||||
@@ -493,13 +490,13 @@ Unit* PetAI::SelectNextTarget(bool allowAutoSelect) const
|
||||
|
||||
// Check owner attackers
|
||||
if (Unit* ownerAttacker = owner->getAttackerForHelper())
|
||||
if (!ownerAttacker->HasBreakableByDamageCrowdControlAura() && me->_CanDetectFeignDeathOf(ownerAttacker) && me->CanCreatureAttack(ownerAttacker))
|
||||
if (!ownerAttacker->HasBreakableByDamageCrowdControlAura() && me->CanCreatureAttack(ownerAttacker))
|
||||
return ownerAttacker;
|
||||
|
||||
// Check owner victim
|
||||
// 3.0.2 - Pets now start attacking their owners victim in defensive mode as soon as the hunter does
|
||||
if (Unit* ownerVictim = owner->GetVictim())
|
||||
if (me->_CanDetectFeignDeathOf(ownerVictim) && me->CanCreatureAttack(ownerVictim))
|
||||
if (me->CanCreatureAttack(ownerVictim))
|
||||
return ownerVictim;
|
||||
|
||||
// Neither pet or owner had a target and aggressive pets can pick any target
|
||||
|
||||
Reference in New Issue
Block a user