diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 6 | ||||
-rwxr-xr-x | src/server/game/Entities/Unit/Unit.h | 7 | ||||
-rwxr-xr-x | src/server/game/Spells/Spell.h | 2 | ||||
-rwxr-xr-x | src/server/game/Spells/SpellEffects.cpp | 9 |
4 files changed, 14 insertions, 10 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a01848a7228..3fd87cd272b 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3012,7 +3012,7 @@ void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool wi Spell* spell = m_currentSpells[spellType]; if (spell && (withDelayed || spell->getState() != SPELL_STATE_DELAYED) - && (withInstant || spell->CalcCastTime() > 0)) + && (withInstant || spell->GetCastTime() > 0)) { // for example, do not let self-stun aura interrupt itself if (!spell->IsInterruptable()) @@ -3049,7 +3049,7 @@ bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skip // Maybe later some special spells will be excluded too. // if skipInstant then instant spells shouldn't count as being casted - if (skipInstant && m_currentSpells[CURRENT_GENERIC_SPELL] && !m_currentSpells[CURRENT_GENERIC_SPELL]->CalcCastTime()) + if (skipInstant && m_currentSpells[CURRENT_GENERIC_SPELL] && !m_currentSpells[CURRENT_GENERIC_SPELL]->GetCastTime()) return false; // generic spells are casted when they are not finished and not delayed @@ -3100,7 +3100,7 @@ Spell* Unit::FindCurrentSpellBySpellId(uint32 spell_id) const int32 Unit::GetCurrentSpellCastTime(uint32 spell_id) const { if (Spell const* spell = FindCurrentSpellBySpellId(spell_id)) - return spell->CalcCastTime(); + return spell->GetCastTime(); return 0; } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 4523397d8e6..877bf115368 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -53,7 +53,8 @@ enum SpellInterruptFlags // See SpellAuraInterruptFlags for other values definitions enum SpellChannelInterruptFlags { - CHANNEL_FLAG_DELAY = 0x4000 + CHANNEL_INTERRUPT_FLAG_INTERRUPT = 0x08, // interrupt + CHANNEL_FLAG_DELAY = 0x4000 }; enum SpellAuraInterruptFlags @@ -1007,8 +1008,8 @@ enum CurrentSpellTypes { CURRENT_MELEE_SPELL = 0, CURRENT_GENERIC_SPELL = 1, - CURRENT_AUTOREPEAT_SPELL = 2, - CURRENT_CHANNELED_SPELL = 3 + CURRENT_CHANNELED_SPELL = 2, + CURRENT_AUTOREPEAT_SPELL = 3 }; #define CURRENT_FIRST_NON_MELEE_SPELL 1 diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 65ed47af322..624c3b9b9b3 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -453,7 +453,7 @@ class Spell UsedSpellMods m_appliedMods; - int32 CalcCastTime() const { return m_casttime; } + int32 GetCastTime() const { return m_casttime; } bool IsAutoRepeat() const { return m_autoRepeat; } void SetAutoRepeat(bool rep) { m_autoRepeat = rep; } void ReSetTimer() { m_timer = m_casttime > 0 ? m_casttime : 0; } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 1c8ce35d50d..8a899522c5d 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -4333,15 +4333,18 @@ void Spell::EffectInterruptCast(SpellEffIndex effIndex) // TODO: not all spells that used this effect apply cooldown at school spells // also exist case: apply cooldown to interrupted cast only and to all spells - for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; ++i) + // there is no CURRENT_AUTOREPEAT_SPELL spells that can be interrupted + for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_AUTOREPEAT_SPELL; ++i) { if (Spell* spell = unitTarget->GetCurrentSpell(CurrentSpellTypes(i))) { SpellInfo const* curSpellInfo = spell->m_spellInfo; // check if we can interrupt spell if ((spell->getState() == SPELL_STATE_CASTING - || (spell->getState() == SPELL_STATE_PREPARING && spell->CalcCastTime() > 0.0f)) - && curSpellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_INTERRUPT && curSpellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE) + || (spell->getState() == SPELL_STATE_PREPARING && spell->GetCastTime() > 0.0f)) + && curSpellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE + && ((i == CURRENT_GENERIC_SPELL && curSpellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_INTERRUPT) + || (i == CURRENT_CHANNELED_SPELL && curSpellInfo->ChannelInterruptFlags & CHANNEL_INTERRUPT_FLAG_INTERRUPT))) { if (m_originalCaster) { |