aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/SpellAuras.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 00c55e1c9b5..66d037ffe41 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -578,9 +578,16 @@ void Aura::Update(uint32 diff)
if (manaPerSecond)
{
if(powertype==POWER_HEALTH)
- caster->ModifyHealth(-manaPerSecond);
- else
+ {
+ if (caster->GetHealth()>manaPerSecond)
+ caster->ModifyHealth(-manaPerSecond);
+ else
+ m_target->RemoveAurasByCasterSpell(GetId(),GetCasterGUID());
+ }
+ else if (caster->GetPower(powertype)>manaPerSecond)
caster->ModifyPower(powertype,-manaPerSecond);
+ else
+ m_target->RemoveAurasByCasterSpell(GetId(),GetCasterGUID());
}
}
}
@@ -5683,7 +5690,6 @@ void Aura::PeriodicTick()
pCaster->SendSpellNonMeleeDamageLog(m_target, GetId(), pdamage, GetSpellSchoolMask(GetSpellProto()), absorb, resist, false, 0);
-
Unit* target = m_target; // aura can be deleted in DealDamage
SpellEntry const* spellProto = GetSpellProto();
float multiplier = spellProto->EffectMultipleValue[GetEffIndex()] > 0 ? spellProto->EffectMultipleValue[GetEffIndex()] : 1;