diff options
| author | Shauren <shauren.trinity@gmail.com> | 2016-11-24 20:22:47 +0100 |
|---|---|---|
| committer | joschiwald <joschiwald.trinity@gmail.com> | 2018-02-11 15:06:24 +0100 |
| commit | 27cdd4b257d01005d9e342b39a4fdf76567d13cf (patch) | |
| tree | 080534dcc700f632bd23afea9935c24568bac669 /src/server/game/Entities | |
| parent | 052422d1659bb2f14ed8880bab12c64ca3c3d71c (diff) | |
Core/Spells: Fixed logic related to movement while channeling
Closes #18289
(cherry picked from commit 90a58117017a93fa33864fe1892e7304e2f3bbf4)
Diffstat (limited to 'src/server/game/Entities')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 12 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.h | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f4242061c78..b31e46473ab 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3018,15 +3018,19 @@ int32 Unit::GetCurrentSpellCastTime(uint32 spell_id) const return 0; } -bool Unit::CanMoveDuringChannel() const +bool Unit::IsMovementPreventedByCasting() const { + // can always move when not casting + if (!HasUnitState(UNIT_STATE_CASTING)) + 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()) - if (!spell->GetSpellInfo()->IsMoveAllowedChannel()) + if (spell->GetSpellInfo()->IsMoveAllowedChannel()) return false; - } + // prohibit movement for all other spell casts return true; } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index db8bcfe6b2c..41a091c36e4 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1556,7 +1556,7 @@ class TC_GAME_API Unit : public WorldObject uint32 GetCastSpellXSpellVisualId(SpellInfo const* spellInfo) const; // Check if our current channel spell has attribute SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING - bool CanMoveDuringChannel() const; + bool IsMovementPreventedByCasting() const; SpellHistory* GetSpellHistory() { return _spellHistory; } SpellHistory const* GetSpellHistory() const { return _spellHistory; } |
