diff options
author | megamage <none@none> | 2009-03-23 16:34:30 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-03-23 16:34:30 -0600 |
commit | a8105dcff636226fbcc1c9c6ece3e8a5d65f0011 (patch) | |
tree | bb865464098bdfac413846a4e9d93fcae07f5b0a /src | |
parent | e9fb303e362717b848b3cda10e69f44eb9791399 (diff) |
*Do not proc anything when aura is removed by cancel.
*Remove aura by cancel when duel complete. This fix a crash.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Player.cpp | 4 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 8 | ||||
-rw-r--r-- | src/game/SpellHandler.cpp | 22 |
3 files changed, 8 insertions, 26 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 4f338cd4823..364fea07cce 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -6730,7 +6730,7 @@ void Player::DuelComplete(DuelCompleteType type) } for(size_t i=0; i<auras2remove.size(); i++) - duel->opponent->RemoveAurasDueToSpell(auras2remove[i]); + duel->opponent->RemoveAurasDueToSpellByCancel(auras2remove[i]); auras2remove.clear(); AuraMap const& auras = GetAuras(); @@ -6740,7 +6740,7 @@ void Player::DuelComplete(DuelCompleteType type) auras2remove.push_back(i->second->GetId()); } for(size_t i=0; i<auras2remove.size(); i++) - RemoveAurasDueToSpell(auras2remove[i]); + RemoveAurasDueToSpellByCancel(auras2remove[i]); // cleanup combo points if(GetComboTarget()==duel->opponent->GetGUID()) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 1e6c10a3b8a..ee8f2717c64 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1022,6 +1022,10 @@ void Aura::_RemoveAura() ((Player*)caster)->SendCooldownEvent(GetSpellProto()); } + // do not proc anything if aura is cancelled + if(m_removeMode == AURA_REMOVE_BY_CANCEL) + return; + // Remove Linked Auras (on last aura remove) uint32 id = GetId(); if(spellmgr.GetSpellCustomAttr(id) & SPELL_ATTR_CU_LINK_REMOVE) @@ -1059,7 +1063,7 @@ void Aura::_RemoveAura() uint32 procEx=0; if (m_removeMode == AURA_REMOVE_BY_ENEMY_SPELL) procEx = PROC_EX_AURA_REMOVE_DESTROY; - else if (m_removeMode == AURA_REMOVE_BY_DEFAULT || m_removeMode == AURA_REMOVE_BY_CANCEL) + else if (m_removeMode == AURA_REMOVE_BY_DEFAULT)// || m_removeMode == AURA_REMOVE_BY_CANCEL) procEx = PROC_EX_AURA_REMOVE_EXPIRE; caster->ProcDamageAndSpell(m_target,ProcCaster, ProcVictim, procEx, m_modifier.m_amount, BASE_ATTACK, m_spellProto); @@ -2282,7 +2286,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real) else { // Final heal only on dispelled or duration end - if ( !(GetAuraDuration() <= 0 || m_removeMode==AURA_REMOVE_BY_ENEMY_SPELL) ) + if (GetAuraDuration() > 0 && m_removeMode != AURA_REMOVE_BY_ENEMY_SPELL) return; // final heal diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index 1629af5a802..b9e773437b6 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -325,28 +325,6 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket) if(!IsPositiveSpell(spellId) || (spellInfo->Attributes & SPELL_ATTR_CANT_CANCEL)) return; - // lifebloom must delete final heal effect - if (spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && (spellInfo->SpellFamilyFlags[1] & 0x10) ) - { - Unit::AuraMap::iterator iter; - while((iter = _player->m_Auras.find(Unit::spellEffectPair(spellId, 1))) != _player->m_Auras.end()) - { - _player->m_modAuras[SPELL_AURA_DUMMY].remove(iter->second); - - Aura* Aur = iter->second; - _player->m_Auras.erase(iter); - ++_player->m_removedAuras; // internal count used by unit update - - delete Aur; - - if( _player->m_Auras.empty() ) - iter = _player->m_Auras.end(); - else - iter = _player->m_Auras.begin(); - - } - } - // channeled spell case (it currently casted then) if(IsChanneledSpell(spellInfo)) { |