diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2016-05-13 23:20:47 +0200 |
|---|---|---|
| committer | Treeston <treeston.mmoc@gmail.com> | 2016-05-13 23:20:47 +0200 |
| commit | 2ae85d86d3d1c6a465f9382ec31f6649afa4326c (patch) | |
| tree | d76e3e0a3417cb1cd5163ca1b8c6a5774ddac0e0 /src/server/game/Entities/Unit | |
| parent | 6040e30fa381efdfc466d635bc6fe150d878e5ed (diff) | |
| parent | bf2cee8cce39e64590dc68bc35e5d3d2dd19cbaf (diff) | |
Merge pull request #17037 from Keader/TargetedMovementGeneratorFix
Core/Movement: Fix issues where creatures cancel spell casts chasing target and Implement SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING
Diffstat (limited to 'src/server/game/Entities/Unit')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 9 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.h | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index ee815f199bd..0e9aa4395a3 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3189,6 +3189,15 @@ int32 Unit::GetCurrentSpellCastTime(uint32 spell_id) const return 0; } +bool Unit::CanMoveDuringChannel() const +{ + if (Spell* spell = m_currentSpells[CURRENT_CHANNELED_SPELL]) + if (spell->getState() != SPELL_STATE_FINISHED) + return spell->GetSpellInfo()->HasAttribute(SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING) && spell->IsChannelActive(); + + return false; +} + bool Unit::isInFrontInMap(Unit const* target, float distance, float arc) const { return IsWithinDistInMap(target, distance) && HasInArc(arc, target); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index d49d2fd9842..b1571e4379f 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1858,6 +1858,9 @@ class TC_GAME_API Unit : public WorldObject Spell* FindCurrentSpellBySpellId(uint32 spell_id) const; int32 GetCurrentSpellCastTime(uint32 spell_id) const; + // Check if our current channel spell has attribute SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING + bool CanMoveDuringChannel() const; + SpellHistory* GetSpellHistory() { return m_spellHistory; } SpellHistory const* GetSpellHistory() const { return m_spellHistory; } |
