Core/Movement: Replace old TargetedMovementGenerator into ChaseMovementGenerator and FollowMovementGenerator, full rewrite for both.

Port From (https://github.com/TrinityCore/TrinityCore/commit/14939204955d1a24fe465cdfcbf307daf3ce4f09)
This commit is contained in:
hondacrx
2021-09-26 10:29:27 -04:00
parent 4004f583a9
commit ad1975b277
22 changed files with 712 additions and 629 deletions
@@ -284,7 +284,7 @@ namespace Game.Movement
creature.GetAI().MovementInform(MovementGeneratorType.Waypoint, (uint)_currentNode);
}
public override bool GetResetPosition(Unit u, out float x, out float y, out float z)
public bool GetResetPosition(Unit u, out float x, out float y, out float z)
{
x = y = z = 0;
// prevent a crash at empty waypoint path.
@@ -301,13 +301,13 @@ namespace Game.Movement
return true;
}
public override void Pause(uint timer = 0)
public void Pause(uint timer = 0)
{
_stalled = timer == 0;
_nextMoveTime.Reset(timer != 0 ? (int)timer : 1);
}
public override void Resume(uint overrideTimer = 0)
public void Resume(uint overrideTimer = 0)
{
_stalled = false;
if (overrideTimer != 0)
@@ -321,7 +321,7 @@ namespace Game.Movement
public override MovementGeneratorType GetMovementGeneratorType() { return MovementGeneratorType.Waypoint; }
public override void UnitSpeedChanged() { _recalculateSpeed = true; }
public void UnitSpeedChanged() { _recalculateSpeed = true; }
TimeTrackerSmall _nextMoveTime;
bool _recalculateSpeed;