From 4eb46ebe0f3ef634020270109402643b72c2bdea Mon Sep 17 00:00:00 2001 From: Leijurv Date: Mon, 13 Aug 2018 13:49:05 -0700 Subject: [PATCH] guard --- src/main/java/baritone/bot/behavior/impl/PathingBehavior.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/baritone/bot/behavior/impl/PathingBehavior.java b/src/main/java/baritone/bot/behavior/impl/PathingBehavior.java index 21d5fdfc..91e56da4 100644 --- a/src/main/java/baritone/bot/behavior/impl/PathingBehavior.java +++ b/src/main/java/baritone/bot/behavior/impl/PathingBehavior.java @@ -279,6 +279,10 @@ public class PathingBehavior extends Behavior { float partialTicks = event.getPartialTicks(); long start = System.nanoTime(); + PathExecutor current = this.current; // this should prevent most race conditions? + PathExecutor next = this.next; // like, now it's not possible for current!=null to be true, then suddenly false because of another thread + // TODO is this enough, or do we need to acquire a lock here? + // Render the current path, if there is one if (current != null && current.getPath() != null) { int renderBegin = Math.max(current.getPosition() - 3, 0);