From 5b395ce3da2de3b83ecd039c65b9db83753ef8e9 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 7 Nov 2018 17:23:36 -0800 Subject: [PATCH] should be in the synchronized block --- .../baritone/behavior/PathingBehavior.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/main/java/baritone/behavior/PathingBehavior.java b/src/main/java/baritone/behavior/PathingBehavior.java index 6315e15f..51550995 100644 --- a/src/main/java/baritone/behavior/PathingBehavior.java +++ b/src/main/java/baritone/behavior/PathingBehavior.java @@ -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"); } } - } - - if (talkAboutIt && current != null && current.getPath() != null) { - if (goal == null || goal.isInGoal(current.getPath().getDest())) { - logDebug("Finished finding a path from " + start + " to " + goal + ". " + current.getPath().getNumNodesConsidered() + " nodes considered"); - } else { - logDebug("Found path segment from " + start + " towards " + goal + ". " + current.getPath().getNumNodesConsidered() + " nodes considered"); - + if (talkAboutIt && current != null && current.getPath() != null) { + if (goal == null || goal.isInGoal(current.getPath().getDest())) { + logDebug("Finished finding a path from " + start + " to " + 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; } }); }