Fixes falling though map when using charge on a hill.

This commit is contained in:
hondacrx
2022-07-20 01:39:25 -04:00
parent 1ae937efe5
commit 17f3eab338
6 changed files with 15 additions and 8 deletions
@@ -991,7 +991,7 @@ namespace Game.Movement
// ok, _pathPoints[i] is too close, _pathPoints[i-1] is not, so our target point is somewhere between the two...
// ... settle for a guesstimate since i'm not confident in doing trig on every chase motion tick...
// (@todo review this)
_pathPoints[i] += (_pathPoints[i - 1] - _pathPoints[i]).directionOrZero() * (dist - (_pathPoints[i] - target).Length());
_pathPoints[i] += (_pathPoints[i - 1] - _pathPoints[i]).direction() * (dist - (_pathPoints[i] - target).Length());
Array.Resize(ref _pathPoints, i + 1);
}