Core/Creatures: Fix IsMovementPreventedByCasting logic
Port From (https://github.com/TrinityCore/TrinityCore/commit/e2ed3e23f8241933b4f931e9def7eee69f1abb79)
This commit is contained in:
@@ -1145,22 +1145,22 @@ namespace Game.Entities
|
||||
|
||||
public override bool IsMovementPreventedByCasting()
|
||||
{
|
||||
// Can always move when not casting
|
||||
if (!HasUnitState(UnitState.Casting))
|
||||
return false;
|
||||
|
||||
// first check if currently a movement allowed channel is active and we're not casting
|
||||
Spell spell = GetCurrentSpell(CurrentSpellTypes.Channeled);
|
||||
if (spell != null)
|
||||
{
|
||||
if (spell.GetState() != SpellState.Finished && spell.IsChannelActive())
|
||||
if (spell.CheckMovement() != SpellCastResult.SpellCastOk)
|
||||
if (HasUnitState(UnitState.Casting))
|
||||
return true;
|
||||
}
|
||||
|
||||
if (HasSpellFocus())
|
||||
return true;
|
||||
|
||||
if (HasUnitState(UnitState.Casting))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user