should be in the synchronized block

This commit is contained in:
Leijurv 2018-11-07 17:23:36 -08:00
parent 40da7b3734
commit 5b395ce3da
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -430,18 +430,16 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior,
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");
} }
} }
} if (talkAboutIt && current != null && current.getPath() != null) {
if (goal == null || goal.isInGoal(current.getPath().getDest())) {
if (talkAboutIt && current != null && current.getPath() != null) { logDebug("Finished finding a path from " + start + " to " + goal + ". " + current.getPath().getNumNodesConsidered() + " nodes considered");
if (goal == null || goal.isInGoal(current.getPath().getDest())) { } else {
logDebug("Finished finding a path from " + start + " to " + goal + ". " + current.getPath().getNumNodesConsidered() + " nodes considered"); logDebug("Found path segment from " + start + " towards " + goal + ". " + current.getPath().getNumNodesConsidered() + " nodes considered");
} else { }
logDebug("Found path segment from " + start + " towards " + goal + ". " + current.getPath().getNumNodesConsidered() + " nodes considered"); }
synchronized (pathCalcLock) {
isPathCalcInProgress = false;
} }
}
synchronized (pathCalcLock) {
isPathCalcInProgress = false;
} }
}); });
} }