aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMeji <alvaro.megias@outlook.com>2023-01-09 23:08:22 +0100
committerGitHub <noreply@github.com>2023-01-09 23:08:22 +0100
commite2ed3e23f8241933b4f931e9def7eee69f1abb79 (patch)
tree9ce1057d4b328333b3e86d65ec741eab3b1dc175 /src
parentd90b526c28cf3b33e52d3ce432cdade1ce5e050e (diff)
Core/Creatures: Fix IsMovementPreventedByCasting logic (#28551)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 68d225ba0d3..c0c65a43061 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -3389,20 +3389,21 @@ void Creature::DoNotReacquireSpellFocusTarget()
bool Creature::IsMovementPreventedByCasting() const
{
+ // Can always move when not casting
+ if (!HasUnitState(UNIT_STATE_CASTING))
+ return false;
+
// first check if currently a movement allowed channel is active and we're not casting
if (Spell* spell = m_currentSpells[CURRENT_CHANNELED_SPELL])
{
if (spell->getState() != SPELL_STATE_FINISHED && spell->IsChannelActive())
if (spell->CheckMovement() != SPELL_CAST_OK)
- return false;
+ return true;
}
if (HasSpellFocus())
return true;
- if (HasUnitState(UNIT_STATE_CASTING))
- return true;
-
return false;
}