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
+1 -1
View File
@@ -207,7 +207,7 @@ namespace Game.Chat
for (int i = 0; i < navmesh.getMaxTiles(); ++i)
{
Detour.dtMeshTile tile = navmesh.getTile(i);
if (tile == null)
if (tile.header == null)
continue;
tileCount++;
@@ -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);
}