Core/Creatures: Fix IsMovementPreventedByCasting logic

Port From (https://github.com/TrinityCore/TrinityCore/commit/e2ed3e23f8241933b4f931e9def7eee69f1abb79)
This commit is contained in:
hondacrx
2023-01-11 01:25:23 -05:00
parent 8e2e799e94
commit b5c9ce5b7e
+4 -4
View File
@@ -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;
}