mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-27 23:56:25 +00:00
fix(Core/Pets): Properly cast spells on friendly target if not in LoS… (#9570)
* fix(Core/Pets): Properly cast spells on friendly target if not in LoS or out of range. Fixes #7790
This commit is contained in:
@@ -60,6 +60,11 @@ bool PetAI::_needToStop()
|
||||
return !me->CanCreatureAttack(me->GetVictim());
|
||||
}
|
||||
|
||||
void PetAI::PetStopAttack()
|
||||
{
|
||||
_stopAttack();
|
||||
}
|
||||
|
||||
void PetAI::_stopAttack()
|
||||
{
|
||||
if (!me->IsAlive())
|
||||
@@ -174,7 +179,7 @@ void PetAI::UpdateAI(uint32 diff)
|
||||
else
|
||||
_doMeleeAttack();
|
||||
}
|
||||
else if (!me->GetCharmInfo() || (!me->GetCharmInfo()->GetForcedSpell() && !me->HasUnitState(UNIT_STATE_CASTING)))
|
||||
else if (!me->GetCharmInfo() || (!me->GetCharmInfo()->GetForcedSpell() && !(me->IsPet() && me->ToPet()->HasTempSpell()) && !me->HasUnitState(UNIT_STATE_CASTING)))
|
||||
{
|
||||
if (me->HasReactState(REACT_AGGRESSIVE) || me->GetCharmInfo()->IsAtStay())
|
||||
{
|
||||
|
||||
@@ -67,6 +67,8 @@ public:
|
||||
void EnterEvadeMode() override {} // For fleeing, pets don't use this type of Evade mechanic
|
||||
void SpellHit(Unit* caster, const SpellInfo* spellInfo) override;
|
||||
|
||||
void PetStopAttack() override;
|
||||
|
||||
private:
|
||||
bool _isVisible(Unit*) const;
|
||||
bool _needToStop(void);
|
||||
|
||||
Reference in New Issue
Block a user