mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Core/Creatures: Fix IsMovementPreventedByCasting logic (#28551)
This commit is contained in:
@@ -3389,20 +3389,21 @@ void Creature::DoNotReacquireSpellFocusTarget()
|
||||
|
||||
bool Creature::IsMovementPreventedByCasting() const
|
||||
{
|
||||
// Can always move when not casting
|
||||
if (!HasUnitState(UNIT_STATE_CASTING))
|
||||
return false;
|
||||
|
||||
// first check if currently a movement allowed channel is active and we're not casting
|
||||
if (Spell* spell = m_currentSpells[CURRENT_CHANNELED_SPELL])
|
||||
{
|
||||
if (spell->getState() != SPELL_STATE_FINISHED && spell->IsChannelActive())
|
||||
if (spell->CheckMovement() != SPELL_CAST_OK)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (HasSpellFocus())
|
||||
return true;
|
||||
|
||||
if (HasUnitState(UNIT_STATE_CASTING))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user