improve pathingbehavior resiliency

This commit is contained in:
Leijurv 2018-11-27 10:37:48 -08:00
parent a8404a7286
commit 043d6ffd20
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 4 additions and 2 deletions

View File

@ -470,7 +470,9 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior,
queuePathEvent(PathEvent.NEXT_CALC_FAILED); queuePathEvent(PathEvent.NEXT_CALC_FAILED);
} }
} else { } else {
throw new IllegalStateException("I have no idea what to do with this path"); //throw new IllegalStateException("I have no idea what to do with this path");
// no point in throwing an exception here, and it gets it stuck with inProgress being not null
logDirect("Warning: PathingBehaivor illegal state! Discarding invalid path!");
} }
} }
if (talkAboutIt && current != null && current.getPath() != null) { if (talkAboutIt && current != null && current.getPath() != null) {

View File

@ -86,7 +86,7 @@ public abstract class AbstractNodeCostSearch implements IPathFinder {
@Override @Override
public synchronized PathCalculationResult calculate(long primaryTimeout, long failureTimeout) { public synchronized PathCalculationResult calculate(long primaryTimeout, long failureTimeout) {
if (isFinished) { if (isFinished) {
throw new IllegalStateException("Path Finder is currently in use, and cannot be reused!"); throw new IllegalStateException("Path finder cannot be reused!");
} }
cancelRequested = false; cancelRequested = false;
try { try {