diff options
| author | Shauren <shauren.trinity@gmail.com> | 2022-05-07 23:31:55 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-05-07 23:31:55 +0200 |
| commit | 538fa8e97ff4b4e36a59e37fd74ea8958e6e30d2 (patch) | |
| tree | a41886fe93437c3381eae6e52552a22d5c005e23 /src/server/game/Entities | |
| parent | 0620b829b2597777f2b5d931dfb0336f79dfd0df (diff) | |
Core/Spells: Cleanup movement checks in spells - use correct interrupt flags
Diffstat (limited to 'src/server/game/Entities')
| -rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 35fc80c0e22..03f2b9f783e 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -3363,7 +3363,7 @@ bool Creature::IsMovementPreventedByCasting() const if (Spell* spell = m_currentSpells[CURRENT_CHANNELED_SPELL]) { if (spell->getState() != SPELL_STATE_FINISHED && spell->IsChannelActive()) - if (spell->GetSpellInfo()->IsMoveAllowedChannel()) + if (spell->CheckMovement() != SPELL_CAST_OK) return false; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5ae10b11ca9..b4a689e6f4a 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2784,8 +2784,7 @@ void Unit::_UpdateAutoRepeatSpell() // check "realtime" interrupts // don't cancel spells which are affected by a SPELL_AURA_CAST_WHILE_WALKING effect - if (((GetTypeId() == TYPEID_PLAYER && ToPlayer()->isMoving()) || IsNonMeleeSpellCast(false, false, true, autoRepeatSpellInfo->Id == 75)) && - !CanCastSpellWhileMoving(autoRepeatSpellInfo)) + if ((isMoving() && m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->CheckMovement() != SPELL_CAST_OK) || IsNonMeleeSpellCast(false, false, true, autoRepeatSpellInfo->Id == 75)) { // cancel wand shoot if (autoRepeatSpellInfo->Id != 75) @@ -3015,7 +3014,7 @@ bool Unit::IsMovementPreventedByCasting() const // channeled spells during channel stage (after the initial cast timer) allow movement with a specific spell attribute if (Spell* spell = m_currentSpells[CURRENT_CHANNELED_SPELL]) if (spell->getState() != SPELL_STATE_FINISHED && spell->IsChannelActive()) - if (spell->GetSpellInfo()->IsMoveAllowedChannel()) + if (spell->GetSpellInfo()->IsMoveAllowedChannel() || CanCastSpellWhileMoving(spell->GetSpellInfo())) return false; // prohibit movement for all other spell casts |
