*Do not proc anything when aura is removed by cancel.

*Remove aura by cancel when duel complete. This fix a crash.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-23 16:34:30 -06:00
parent e9fb303e36
commit a8105dcff6
3 changed files with 8 additions and 26 deletions
+2 -2
View File
@@ -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())
+6 -2
View File
@@ -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
-22
View File
@@ -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))
{