-
Notifications
You must be signed in to change notification settings - Fork 244
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
Subsequent calls to PathFinderRequest.search throw exception #92
Comments
Glad to see you back again. |
Not sure how to reproduce your issue, but after a quick glance at the stack trace I guess that replacing the loop do { ... } while (openList.size > 0); with the loop Can you confirm? |
I can check this evening but I've attached a quick example I wrote the other day trying to solve the issue. I think the issue may be a documentation problem as I might be using the API wrong? |
Well, yes, I have to admit that the documentation about interruptible pathfinding is not exhaustive at all. It might be worth adding a check before the above-mentioned loop in order to detect and report possible improper use of the API. I mean, something like if (openList.size == 0) {
throw new RuntimeException("The open list is unexpectedly empty. Usually, this means that you're misusing the API.");
} |
Issue details
It seems that once the path is found or not found, subsequent calls to PathFinderRequest.search will throw an exception. I was receiving the exception in my game and it took some time to figure out. I would expect that calling search after the path is found or not found would just immediately return true.
Version of gdx-ai and/or relevant dependencies
1.9.6
Stacktrace
The text was updated successfully, but these errors were encountered: