aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Unit
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-04-27 10:59:09 -0300
committerariel- <ariel-@users.noreply.github.com>2017-04-27 11:00:01 -0300
commit3ea46e57afe26778704647084cc6fa55a798e510 (patch)
treee9d3a686d12224995413c83c317138c2018ce9b8 /src/server/game/Entities/Unit
parent229444b74a7e2176db142e0446d4268995c5aad6 (diff)
Core/Unit: 229444b74a follow-up
- IsFocusing is made virtual again, so there's no need to keep a duplicated function This reverts commit 5043639c563514c079ba6eb959dd4c1c555fa494.
Diffstat (limited to 'src/server/game/Entities/Unit')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp3
-rw-r--r--src/server/game/Entities/Unit/Unit.h4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index fc1aed52609..0e81d3384b9 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -3325,6 +3325,9 @@ bool Unit::IsMovementPreventedByCasting() const
if (spell->GetSpellInfo()->IsMoveAllowedChannel())
return false;
+ if (const_cast<Unit*>(this)->IsFocusing(nullptr, true))
+ 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 3312e88d3ba..55dc8040de3 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1903,7 +1903,9 @@ class TC_GAME_API Unit : public WorldObject
int32 GetCurrentSpellCastTime(uint32 spell_id) const;
virtual bool IsFocusing(Spell const* /*focusSpell*/ = nullptr, bool /*withDelay*/ = false) { return false; }
- virtual bool IsMovementPreventedByCasting() const;
+
+ // Check if our current channel spell has attribute SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING
+ bool IsMovementPreventedByCasting() const;
SpellHistory* GetSpellHistory() { return m_spellHistory; }
SpellHistory const* GetSpellHistory() const { return m_spellHistory; }