Core/Auras: fixed Drain Mana breaking early if caster has Mana Feed talent but no active pet

This commit is contained in:
ariel-
2018-02-17 17:50:05 -03:00
committed by Aokromes
parent 3adfc66859
commit e219b3f940

View File

@@ -5969,14 +5969,13 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con
target->AddThreat(caster, float(gainedAmount) * 0.5f, GetSpellInfo()->GetSchoolMask(), GetSpellInfo());
}
// Drain Mana
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK
&& m_spellInfo->SpellFamilyFlags[0] & 0x00000010)
// Drain Mana - Mana Feed effect
if (caster->GetGuardianPet() && m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->SpellFamilyFlags[0] & 0x00000010)
{
int32 manaFeedVal = 0;
if (AuraEffect const* aurEff = GetBase()->GetEffect(1))
if (AuraEffect const* aurEff = GetBase()->GetEffect(EFFECT_1))
manaFeedVal = aurEff->GetAmount();
// Mana Feed - Drain Mana
if (manaFeedVal > 0)
{
int32 feedAmount = CalculatePct(gainedAmount, manaFeedVal);