diff options
| author | megamage <none@none> | 2009-08-19 16:52:51 -0500 |
|---|---|---|
| committer | megamage <none@none> | 2009-08-19 16:52:51 -0500 |
| commit | 012d6fa865fb8083dcbeae9b04926527b3c19f4e (patch) | |
| tree | 46b2b2c30d751888d2dd91fc31c9bd0457790b7f /src/game/SpellHandler.cpp | |
| parent | 618162052007b3e9003db858ea33eed11f5af4df (diff) | |
[8381] Some refactoring work in Unit::m_currentSpells code. Author: VladimirMangos
* Restrict access, use enum args, move some repeated code parts to function.
* Make m_selfContainer set only part of Unit::SetCurrentCastedSpell
--HG--
branch : trunk
Diffstat (limited to 'src/game/SpellHandler.cpp')
| -rw-r--r-- | src/game/SpellHandler.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index ae29503e753..ab1ce6c4ba9 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -325,8 +325,8 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) // Client is resending autoshot cast opcode when other spell is casted during shoot rotation // Skip it to prevent "interrupt" message - if (IsAutoRepeatRangedSpell(spellInfo) && _player->m_currentSpells[CURRENT_AUTOREPEAT_SPELL] - && _player->m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo == spellInfo) + if (IsAutoRepeatRangedSpell(spellInfo) && _player->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL) + && _player->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL)->m_spellInfo == spellInfo) return; // can't use our own spells when we're in possession of another unit, @@ -381,9 +381,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; } |
