Core/Movement: Prevent NO_PATH evades from incorrectly happening in a few places.

Port From (https://github.com/TrinityCore/TrinityCore/commit/6f0e58cce0088dd030d5bf85ae03e9d942241800)
This commit is contained in:
hondacrx
2021-10-30 20:01:28 -04:00
parent 5d94082841
commit 5675589bd2
@@ -85,6 +85,9 @@ namespace Game.Movement
{
owner.StopMoving();
_lastTargetPosition = null;
Creature cOwner = owner.ToCreature();
if (cOwner != null)
cOwner.SetCannotReachTarget(false);
return true;
}
@@ -119,6 +122,9 @@ namespace Game.Movement
if (owner.HasUnitState(UnitState.ChaseMove) && owner.MoveSpline.Finalized())
{
_path = null;
Creature cOwner = owner.ToCreature();
if (cOwner != null)
cOwner.SetCannotReachTarget(false);
owner.ClearUnitState(UnitState.ChaseMove);
owner.SetInFront(target);
DoMovementInform(owner, target);
@@ -201,6 +207,9 @@ namespace Game.Movement
{
AddFlag(MovementGeneratorFlags.Deactivated);
owner.ClearUnitState(UnitState.ChaseMove);
Creature cOwner = owner.ToCreature();
if (cOwner != null)
cOwner.SetCannotReachTarget(false);
}
public override void Finalize(Unit owner, bool active, bool movementInform)