mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-25 17:43:44 +00:00
Check whether findNearestPoly actually did find a poly.
This commit is contained in:
parent
ea2592a83d
commit
7556f29c09
1 changed files with 2 additions and 2 deletions
|
|
@ -351,14 +351,14 @@ bool NavPath::visitNext()
|
|||
F32 extents[] = {1.0f, 1.0f, 1.0f};
|
||||
dtPolyRef startRef, endRef;
|
||||
|
||||
if(dtStatusFailed(mQuery->findNearestPoly(from, extents, &mFilter, &startRef, start)))
|
||||
if(dtStatusFailed(mQuery->findNearestPoly(from, extents, &mFilter, &startRef, from)) || !startRef)
|
||||
{
|
||||
Con::errorf("No NavMesh polygon near visit point (%g, %g, %g) of NavPath %s",
|
||||
start.x, start.y, start.z, getIdString());
|
||||
return false;
|
||||
}
|
||||
|
||||
if(dtStatusFailed(mQuery->findNearestPoly(to, extents, &mFilter, &endRef, end)))
|
||||
if(dtStatusFailed(mQuery->findNearestPoly(to, extents, &mFilter, &endRef, to)) || !startRef)
|
||||
{
|
||||
Con::errorf("No NavMesh polygon near visit point (%g, %g, %g) of NavPath %s",
|
||||
end.x, end.y, end.z, getIdString());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue