diff options
author | megamage <none@none> | 2009-04-19 14:35:55 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-04-19 14:35:55 -0500 |
commit | 995410c475efa13e4b021b1df9f27d8e66fedd23 (patch) | |
tree | 439b1f7282136f7c002fa6eddb4ab96234302290 /src/game/SpellAuras.cpp | |
parent | 862cd5fcd7a6af09ed4d282c3737d06cebb166b7 (diff) |
*Fix a crash caused by farsight spells.
--HG--
branch : trunk
Diffstat (limited to 'src/game/SpellAuras.cpp')
-rw-r--r-- | src/game/SpellAuras.cpp | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 8f14fb5e5ef..851ad35c0f9 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1264,8 +1264,7 @@ void Aura::DropAuraCharge() { if(m_procCharges) //auras without charges always have charge = 0 { - --m_procCharges; - if(m_procCharges) // Send charge change + if(--m_procCharges) // Send charge change SendAuraUpdate(); else // Last charge dropped m_target->RemoveAura(this); @@ -1274,39 +1273,30 @@ void Aura::DropAuraCharge() bool Aura::IsPersistent() const { - for (uint8 i=0; i<MAX_SPELL_EFFECTS;++i) + for(uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { - if (m_partAuras[i]) - { - if (m_partAuras[i]->IsPersistent()) - return true; - } + if(m_partAuras[i] && m_partAuras[i]->IsPersistent()) + return true; } return false; } bool Aura::IsAreaAura() const { - for (uint8 i=0; i<MAX_SPELL_EFFECTS;++i) + for(uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { - if (m_partAuras[i]) - { - if (m_partAuras[i]->IsAreaAura()) - return true; - } + if(m_partAuras[i] && m_partAuras[i]->IsAreaAura()) + return true; } return false; } bool Aura::IsAuraType(AuraType type) const { - for (uint8 i=0; i<MAX_SPELL_EFFECTS;++i) + for(uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { - if (m_partAuras[i]) - { - if (m_partAuras[i]->GetAuraName()==type) - return true; - } + if(m_partAuras[i] && m_partAuras[i]->GetAuraName() == type) + return true; } return false; } |