forked from bit/DotRecastNetSim
bugfix - nullable straightPath
This commit is contained in:
parent
58890825b3
commit
4112168f4a
|
@ -1532,14 +1532,14 @@ namespace DotRecast.Detour
|
|||
ref List<StraightPathItem> straightPath,
|
||||
int maxStraightPath, int options)
|
||||
{
|
||||
straightPath.Clear();
|
||||
|
||||
if (!RcVec3f.IsFinite(startPos) || !RcVec3f.IsFinite(endPos)
|
||||
if (!RcVec3f.IsFinite(startPos) || !RcVec3f.IsFinite(endPos) || null == straightPath
|
||||
|| null == path || 0 == path.Count || path[0] == 0 || maxStraightPath <= 0)
|
||||
{
|
||||
return DtStatus.DT_FAILURE | DtStatus.DT_INVALID_PARAM;
|
||||
}
|
||||
|
||||
straightPath.Clear();
|
||||
|
||||
// TODO: Should this be callers responsibility?
|
||||
var closestStartPosRes = ClosestPointOnPolyBoundary(path[0], startPos, out var closestStartPos);
|
||||
if (closestStartPosRes.Failed())
|
||||
|
@ -2794,7 +2794,6 @@ namespace DotRecast.Detour
|
|||
IDtQueryFilter filter,
|
||||
ref List<long> resultRef, ref List<long> resultParent)
|
||||
{
|
||||
|
||||
// Validate input
|
||||
if (!m_nav.IsValidPolyRef(startRef) || !RcVec3f.IsFinite(centerPos) || radius < 0
|
||||
|| !float.IsFinite(radius) || null == filter)
|
||||
|
|
Loading…
Reference in New Issue