From a9cac7718e6c2cfb7cf75383a1bfcfe1e8d7f686 Mon Sep 17 00:00:00 2001 From: Brady Date: Tue, 21 Aug 2018 16:36:51 -0500 Subject: [PATCH] Fix inputs overrides not resetting when out of world, fixes #43 --- .../java/baritone/bot/behavior/impl/PathingBehavior.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/baritone/bot/behavior/impl/PathingBehavior.java b/src/main/java/baritone/bot/behavior/impl/PathingBehavior.java index 269cf200..55b27b0d 100644 --- a/src/main/java/baritone/bot/behavior/impl/PathingBehavior.java +++ b/src/main/java/baritone/bot/behavior/impl/PathingBehavior.java @@ -56,8 +56,7 @@ public class PathingBehavior extends Behavior { @Override public void onTick(TickEvent event) { if (event.getType() == TickEvent.Type.OUT) { - current = null; - next = null; + this.cancel(); return; } if (current == null) { @@ -148,7 +147,9 @@ public class PathingBehavior extends Behavior { return current; } - public PathExecutor getNext() {return next;} + public PathExecutor getNext() { + return next; + } public Optional getPath() { return Optional.ofNullable(current).map(PathExecutor::getPath);