fix(Core/Pets): Handle health-aurastates on pet loading. (#11491)
Fixes #11481
This commit is contained in:
parent
3c97c7dd2e
commit
d6c95b4db8
1 changed files with 10 additions and 10 deletions
|
|
@ -1831,16 +1831,16 @@ bool Pet::addSpell(uint32 spellId, ActiveStates active /*= ACT_DECIDE*/, PetSpel
|
|||
m_charmInfo->AddSpellToActionBar(spellInfo);
|
||||
|
||||
// unapply aura stats if dont meet requirements
|
||||
// handle only if player is not loaded, loading is handled in loadfromdb
|
||||
if (!m_loading)
|
||||
if (Aura* aura = GetAura(spellId))
|
||||
{
|
||||
if (aura->GetSpellInfo()->CasterAuraState == AURA_STATE_HEALTHLESS_35_PERCENT ||
|
||||
aura->GetSpellInfo()->CasterAuraState == AURA_STATE_HEALTH_ABOVE_75_PERCENT ||
|
||||
aura->GetSpellInfo()->CasterAuraState == AURA_STATE_HEALTHLESS_20_PERCENT )
|
||||
if (!HasAuraState((AuraStateType)aura->GetSpellInfo()->CasterAuraState))
|
||||
aura->HandleAllEffects(aura->GetApplicationOfTarget(GetGUID()), AURA_EFFECT_HANDLE_REAL, false);
|
||||
}
|
||||
if (Aura* aura = GetAura(spellId))
|
||||
{
|
||||
if (aura->GetSpellInfo()->CasterAuraState == AURA_STATE_HEALTHLESS_35_PERCENT ||
|
||||
aura->GetSpellInfo()->CasterAuraState == AURA_STATE_HEALTH_ABOVE_75_PERCENT ||
|
||||
aura->GetSpellInfo()->CasterAuraState == AURA_STATE_HEALTHLESS_20_PERCENT )
|
||||
if (!HasAuraState((AuraStateType)aura->GetSpellInfo()->CasterAuraState))
|
||||
{
|
||||
aura->HandleAllEffects(aura->GetApplicationOfTarget(GetGUID()), AURA_EFFECT_HANDLE_REAL, false);
|
||||
}
|
||||
}
|
||||
|
||||
ToggleAutocast(spellInfo, (newspell.active == ACT_ENABLED));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue