Allow walk when chasing

Port From (https://github.com/TrinityCore/TrinityCore/commit/b3f75852c284e730756a7f007b96bbae0ac3c158)
This commit is contained in:
hondacrx
2021-11-23 22:57:55 -05:00
parent 3e31601ba5
commit 7d6f782dd1
2 changed files with 7 additions and 5 deletions
@@ -28,6 +28,7 @@ namespace Game.Movement
ChaseRange? _range;
ChaseAngle? _angle;
bool _walk;
PathGenerator _path;
Position _lastTargetPosition;
@@ -37,11 +38,12 @@ namespace Game.Movement
AbstractFollower _abstractFollower;
public ChaseMovementGenerator(Unit target, ChaseRange? range, ChaseAngle? angle)
public ChaseMovementGenerator(Unit target, ChaseRange? range, ChaseAngle? angle, bool walk = false)
{
_abstractFollower = new AbstractFollower(target);
_range = range;
_angle = angle;
_walk = walk;
Mode = MovementGeneratorMode.Default;
Priority = MovementGeneratorPriority.Normal;
@@ -54,7 +56,7 @@ namespace Game.Movement
RemoveFlag(MovementGeneratorFlags.InitializationPending | MovementGeneratorFlags.Deactivated);
AddFlag(MovementGeneratorFlags.Initialized);
owner.SetWalk(false);
owner.SetWalk(_walk);
_path = null;
_lastTargetPosition = null;
}
@@ -188,7 +190,7 @@ namespace Game.Movement
MoveSplineInit init = new(owner);
init.MovebyPath(_path.GetPath());
init.SetWalk(false);
init.SetWalk(_walk);
init.SetFacing(target);
init.Launch();