[8381] Some refactoring work in Unit::m_currentSpells code.

* Restrict access, use enum args, move some repeated code parts to function.
* Make m_selfContainer set only part of Unit::SetCurrentCastedSpell
This commit is contained in:
VladimirMangos 2009-08-18 02:07:39 +04:00
parent 1b1d013623
commit 74d27294aa
10 changed files with 70 additions and 69 deletions

View file

@ -402,9 +402,9 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket)
// channeled spell case (it currently casted then)
if (IsChanneledSpell(spellInfo))
{
if (_player->m_currentSpells[CURRENT_CHANNELED_SPELL] &&
_player->m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->Id==spellId)
_player->InterruptSpell(CURRENT_CHANNELED_SPELL);
if (Spell* curSpell = _player->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
if (curSpell->m_spellInfo->Id==spellId)
_player->InterruptSpell(CURRENT_CHANNELED_SPELL);
return;
}