[6833] More correct aura cancel for channeled spells.

Remove auras at channeled target.
Cancel channeled spell at spell aura cancel.
Also move battleground resurection spell code to more appropriate place.
This commit is contained in:
VladimirMangos 2008-11-16 23:29:08 +03:00
parent e12e79a94d
commit 0ae2133254
5 changed files with 76 additions and 19 deletions

View file

@ -355,15 +355,23 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket)
if(!IsPositiveSpell(spellId) || (spellInfo->Attributes & SPELL_ATTR_CANT_CANCEL))
return;
_player->RemoveAurasDueToSpellByCancel(spellId);
if (spellId == 2584) // Waiting to resurrect spell cancel, we must remove player from resurrect queue
// channeled spell case (it currently casted then)
if(IsChanneledSpell(spellInfo))
{
BattleGround *bg = _player->GetBattleGround();
if(!bg)
return;
bg->RemovePlayerFromResurrectQueue(_player->GetGUID());
if(Spell* spell = _player->m_currentSpells[CURRENT_CHANNELED_SPELL])
{
if(spell->m_spellInfo->Id==spellId)
{
spell->cancel();
spell->SetReferencedFromCurrent(false);
_player->m_currentSpells[CURRENT_CHANNELED_SPELL] = NULL;
}
}
return;
}
// non channeled case
_player->RemoveAurasDueToSpellByCancel(spellId);
}
void WorldSession::HandlePetCancelAuraOpcode( WorldPacket& recvPacket)