[7663] Fixed crash at interrupting channeled spell. Cleanup spell interrupt code.

This commit is contained in:
VladimirMangos 2009-04-13 10:39:37 +04:00
parent b143a300cb
commit 56350b32ed
4 changed files with 18 additions and 52 deletions

View file

@ -372,17 +372,11 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket)
return;
// channeled spell case (it currently casted then)
if(IsChanneledSpell(spellInfo))
if (IsChanneledSpell(spellInfo))
{
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;
}
}
if (_player->m_currentSpells[CURRENT_CHANNELED_SPELL] &&
_player->m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->Id==spellId)
_player->InterruptSpell(CURRENT_CHANNELED_SPELL);
return;
}