diff options
| author | Trisjdc <trisjdc@gmail.com> | 2014-07-24 03:47:04 +0100 |
|---|---|---|
| committer | Trisjdc <trisjdc@gmail.com> | 2014-07-24 03:47:04 +0100 |
| commit | 3f9f2e3ee56832113e180c9cca01d414c1651955 (patch) | |
| tree | 3f5956b82ad71a546c4b46ec9b522a13e90e9c93 /src | |
| parent | 0e91a0e54c4fd00c71ee4a7fd9d6a305110cbcc8 (diff) | |
Core/Units: IsNonMeleeSpellCast will no longer return false if there's an instant cast spell still arriving at the target with the caster doing a channel
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index d475a0bd6ea..87c92a40df8 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3077,27 +3077,26 @@ bool Unit::IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled, bool skipAu // We don't do loop here to explicitly show that melee spell is excluded. // Maybe later some special spells will be excluded too. - // if skipInstant then instant spells shouldn't count as being cast - if (skipInstant && m_currentSpells[CURRENT_GENERIC_SPELL] && !m_currentSpells[CURRENT_GENERIC_SPELL]->GetCastTime()) - return false; - // generic spells are cast when they are not finished and not delayed if (m_currentSpells[CURRENT_GENERIC_SPELL] && (m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_FINISHED) && (withDelayed || m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_DELAYED)) { - if (!isAutoshoot || !(m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS)) - return true; + if (!skipInstant || m_currentSpells[CURRENT_GENERIC_SPELL]->GetCastTime()) + { + if (!isAutoshoot || !(m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS)) + return true; + } } // channeled spells may be delayed, but they are still considered cast - else if (!skipChanneled && m_currentSpells[CURRENT_CHANNELED_SPELL] && + if (!skipChanneled && m_currentSpells[CURRENT_CHANNELED_SPELL] && (m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED)) { if (!isAutoshoot || !(m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS)) return true; } // autorepeat spells may be finished or delayed, but they are still considered cast - else if (!skipAutorepeat && m_currentSpells[CURRENT_AUTOREPEAT_SPELL]) + if (!skipAutorepeat && m_currentSpells[CURRENT_AUTOREPEAT_SPELL]) return true; return false; |
