From fb4b9bc4e32956421f67bc4aff381d98c4f5808e Mon Sep 17 00:00:00 2001 From: Ovalord <1Don7H4v3@m41L.com> Date: Wed, 7 Feb 2018 11:13:45 +0100 Subject: [PATCH] Core/Spells: fixed a logic mistake that was interrupting channeled spells due to movement --- src/server/game/Entities/Unit/Unit.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index fbe3ca9366b..ce80438e141 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3113,17 +3113,17 @@ int32 Unit::GetCurrentSpellCastTime(uint32 spell_id) const bool Unit::IsMovementPreventedByCasting() const { // can always move when not casting - if (!HasUnitState(UNIT_STATE_CASTING)) - return false; + if (HasUnitState(UNIT_STATE_CASTING)) + return true; // 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()) - return false; + if (!spell->GetSpellInfo()->IsMoveAllowedChannel()) + return true; // prohibit movement for all other spell casts - return true; + return false; } bool Unit::isInFrontInMap(Unit const* target, float distance, float arc) const