Fixed exception when planning results in an empty path.
parent
0304b635a6
commit
5cabf4ca28
|
@ -163,8 +163,13 @@ public class NavigationComponent : Spatial
|
|||
|
||||
// Perform smoothing
|
||||
_planningPathSmoothedWorldNavigationPoints = SmoothPath(body, _planningPathWorldNavigationPoints);
|
||||
|
||||
// Ensure starting point is the current position
|
||||
if (_planningPathSmoothedWorldNavigationPoints.Count > 0)
|
||||
{
|
||||
_planningPathSmoothedWorldNavigationPoints[0] = new NavigationPoint(fromPositionWorld);
|
||||
}
|
||||
}
|
||||
|
||||
public void FindPath(KinematicBody body, Vector3 fromPositionWorld, NavigationPoint navigationPoint)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue