mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
[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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user