Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dtNode* dtNodePool::getNode(dtPolyRef id, unsigned char state) hardlock if Query is initated with too small of maxNodes #45

Open
xeropresence opened this issue Aug 6, 2014 · 2 comments

Comments

@xeropresence
Copy link

We get stuck in this loop

while (i != DT_NULL_IDX)
{
    if (m_nodes[i].id == id && m_nodes[i].state == state)
        return &m_nodes[i];
    i = m_next[i];
}

In the case I can reproduce, there will be a node with the id we are looking for but the state does not match. the variable I jumps back and forth between two values and never reaches the breakout value.

@xeropresence
Copy link
Author

I use a maxnode value of 0xFFFFFF by default...to get this one area to return a partial result and error out I have to use a crazy number of 0xFFFFFFF

@xeropresence
Copy link
Author

Issue happens when calling

dtStatus dtNavMeshQuery::findPath(dtPolyRef startRef, dtPolyRef endRef,
const float* startPos, const float* endPos,
const dtQueryFilter* filter,
dtPolyRef* path, int* pathCount, const int maxPath) const

When a really high query result is used the function runs to completion but a empty path is returned.

If I change

dtNode* neighbourNode = m_nodePool->getNode(neighbourRef, crossSide);

to

dtNode* neighbourNode = m_nodePool->getNode(neighbourRef, 0);

A proper partial path is returned for both my normal and xlarge maxnnode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants