Core/Formation: Fixes creature formation movement not syncing with leader.

This commit is contained in:
hondacrx
2022-07-11 22:21:27 -04:00
parent 077ac3988d
commit 206c5afcca
@@ -167,7 +167,7 @@ namespace Game.Movement
To get a representative result like that we have to predict our formation leader's path To get a representative result like that we have to predict our formation leader's path
and apply our formation shape based on that destination. and apply our formation shape based on that destination.
*/ */
Position dest = target.GetPosition(); Position dest = new Position(target.GetPosition());
float velocity = 0.0f; float velocity = 0.0f;
// Formation leader is moving. Predict our destination // Formation leader is moving. Predict our destination
@@ -209,7 +209,7 @@ namespace Game.Movement
init.SetVelocity(velocity); init.SetVelocity(velocity);
init.Launch(); init.Launch();
_lastLeaderPosition = target.GetPosition(); _lastLeaderPosition = new Position(target.GetPosition());
owner.AddUnitState(UnitState.FollowFormationMove); owner.AddUnitState(UnitState.FollowFormationMove);
RemoveFlag(MovementGeneratorFlags.Interrupted); RemoveFlag(MovementGeneratorFlags.Interrupted);
} }