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

Port From (https://github.com/TrinityCore/TrinityCore/commit/64399f58a37e0c2633d986af6af781e7f7b15998)
This commit is contained in:
hondacrx
2021-08-08 23:33:31 -04:00
parent 89bd0b003d
commit 26a2eced6e
+2 -2
View File
@@ -5256,13 +5256,13 @@ namespace Game.Spells
} }
// Drain Mana // Drain Mana
if (m_spellInfo.SpellFamilyName == SpellFamilyNames.Warlock && m_spellInfo.SpellFamilyFlags[0].HasAnyFlag<uint>(0x00000010)) if (caster.GetGuardianPet() != null && m_spellInfo.SpellFamilyName == SpellFamilyNames.Warlock && m_spellInfo.SpellFamilyFlags[0].HasAnyFlag<uint>(0x00000010))
{ {
int manaFeedVal = 0; int manaFeedVal = 0;
AuraEffect aurEff = GetBase().GetEffect(1); AuraEffect aurEff = GetBase().GetEffect(1);
if (aurEff != null) if (aurEff != null)
manaFeedVal = aurEff.GetAmount(); manaFeedVal = aurEff.GetAmount();
// Mana Feed - Drain Mana
if (manaFeedVal > 0) if (manaFeedVal > 0)
{ {
int feedAmount = MathFunctions.CalculatePct(gainedAmount, manaFeedVal); int feedAmount = MathFunctions.CalculatePct(gainedAmount, manaFeedVal);