fix(Core/PetAI): Combat spells should be casted when pet starts attack. (#9845)
Fixes #2140
This commit is contained in:
@@ -252,9 +252,11 @@ void PetAI::UpdateAI(uint32 diff)
|
|||||||
if (spellInfo->CanBeUsedInCombat())
|
if (spellInfo->CanBeUsedInCombat())
|
||||||
{
|
{
|
||||||
// Check if we're in combat or commanded to attack (exlude auras with infinity duration)
|
// Check if we're in combat or commanded to attack (exlude auras with infinity duration)
|
||||||
if (!me->IsInCombat() && !me->GetCharmInfo()->IsCommandAttack() && spellInfo->GetMaxDuration() != -1)
|
if (!me->IsInCombat() && spellInfo->GetMaxDuration() != -1 && !me->IsPetInCombat())
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Spell* spell = new Spell(me, spellInfo, TRIGGERED_NONE);
|
Spell* spell = new Spell(me, spellInfo, TRIGGERED_NONE);
|
||||||
spell->LoadScripts(); // xinef: load for CanAutoCast (calling CheckPetCast)
|
spell->LoadScripts(); // xinef: load for CanAutoCast (calling CheckPetCast)
|
||||||
|
|||||||
Reference in New Issue
Block a user