diff options
| author | QAston <none@none> | 2009-03-22 11:34:34 +0100 |
|---|---|---|
| committer | QAston <none@none> | 2009-03-22 11:34:34 +0100 |
| commit | b5390f84b9ef023af587558b1ed4cb4e0b7eebb4 (patch) | |
| tree | 40598c58967a131b5c99cea124f6afdc48658261 | |
| parent | f487cec64535e617344e6386ab3ac66d5ebfc65b (diff) | |
*Make auras with periodic power take cancel when there is no more power avalible.
--HG--
branch : trunk
| -rw-r--r-- | src/game/SpellAuras.cpp | 12 |
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; |
