Core/Movement: followup

Port From (https://github.com/TrinityCore/TrinityCore/commit/875da437806b8956324078bc9abd0a495345d2e5)
This commit is contained in:
hondacrx
2022-02-22 13:26:27 -05:00
parent 9721f6406e
commit a911dd50f6
3 changed files with 19 additions and 25 deletions
@@ -288,8 +288,7 @@ namespace Game.Entities
float angle = pair.Value.FollowAngle + MathF.PI; // for some reason, someone thought it was a great idea to invert relativ angles...
float dist = pair.Value.FollowDist;
var moveGen = member.GetMotionMaster().GetMovementGenerator(movement => { return movement.GetMovementGeneratorType() == MovementGeneratorType.Formation; }, MovementSlot.Default);
if (moveGen == null)
if (!member.HasUnitState(UnitState.Formation))
member.GetMotionMaster().MoveFormation(_leader, dist, angle, pair.Value.LeaderWaypointIDs[0], pair.Value.LeaderWaypointIDs[1]);
}
}