Core/Movement: Use a facing spline for chase movement

This commit is contained in:
Shauren
2013-01-19 13:34:17 +01:00
parent c07a4a6745
commit bc35a466e5

View File

@@ -103,7 +103,6 @@ void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T &owner)
return;
*/
D::_addUnitStateMove(owner);
i_targetReached = false;
i_recalculateTravel = false;
@@ -111,6 +110,11 @@ void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T &owner)
Movement::MoveSplineInit init(owner);
init.MoveTo(x, y, z);
init.SetWalk(((D*)this)->EnableWalking());
// Using the same condition for facing target as the one that is used for SetInFront on movement end
// - applies to ChaseMovementGenerator mostly
if (i_angle == 0.f)
init.SetFacing(i_target.getTarget());
init.Launch();
}