aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Unit
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-05-18 11:50:00 +0200
committerShauren <shauren.trinity@gmail.com>2024-05-18 12:08:38 +0200
commitbdb5c72def57bfcf3edba988e9d7b1905d0bd4a6 (patch)
tree0ccfd99f1f673f85bc74e1a619aeab3260b4537f /src/server/game/Entities/Unit
parent7a3eafb621f8607a6e775c4bfe647e32be214462 (diff)
Core/Spells: Prevent creatures from being able to cast all their spells while moving
Closes #26137 (cherry picked from commit f80f931e2bee9dbf08c3edee94d0c79dbbb64072)
Diffstat (limited to 'src/server/game/Entities/Unit')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 43c3446daf9..d412b619be7 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -3123,6 +3123,11 @@ bool Unit::IsMovementPreventedByCasting() const
if (!HasUnitState(UNIT_STATE_CASTING))
return false;
+ if (Spell* spell = m_currentSpells[CURRENT_GENERIC_SPELL])
+ if (spell->getState() == SPELL_STATE_FINISHED ||
+ !(spell->m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT))
+ return false;
+
// 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())