mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 20:56:23 +00:00
fix(Core/Pets): Handle health-aurastates on pet loading. (#11491)
Fixes #11481
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user