Core/Spells: Fixed logic related to movement while channeling

This commit is contained in:
Aokromes committed 2016-11-27 15:47:21 +01:00
1 parent 16d6690d01
commit 0737ea9b6e
5 files changed
+13 -10

No files matched your search

+8 -5
View File
@@ -3001,16 +3001,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;
}