we can cancel calc even if not safe to cancel pathing
This commit is contained in:
parent
cfec67f1f9
commit
bcd097c6cb
@ -325,6 +325,7 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior,
|
|||||||
|
|
||||||
public void softCancelIfSafe() {
|
public void softCancelIfSafe() {
|
||||||
synchronized (pathPlanLock) {
|
synchronized (pathPlanLock) {
|
||||||
|
getInProgress().ifPresent(AbstractNodeCostSearch::cancel); // only cancel ours
|
||||||
if (!isSafeToCancel()) {
|
if (!isSafeToCancel()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -332,7 +333,6 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior,
|
|||||||
next = null;
|
next = null;
|
||||||
}
|
}
|
||||||
cancelRequested = true;
|
cancelRequested = true;
|
||||||
getInProgress().ifPresent(AbstractNodeCostSearch::cancel); // only cancel ours
|
|
||||||
// do everything BUT clear keys
|
// do everything BUT clear keys
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,11 +340,11 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior,
|
|||||||
public void secretInternalSegmentCancel() {
|
public void secretInternalSegmentCancel() {
|
||||||
queuePathEvent(PathEvent.CANCELED);
|
queuePathEvent(PathEvent.CANCELED);
|
||||||
synchronized (pathPlanLock) {
|
synchronized (pathPlanLock) {
|
||||||
|
getInProgress().ifPresent(AbstractNodeCostSearch::cancel);
|
||||||
if (current != null) {
|
if (current != null) {
|
||||||
current = null;
|
current = null;
|
||||||
next = null;
|
next = null;
|
||||||
baritone.getInputOverrideHandler().clearAllKeys();
|
baritone.getInputOverrideHandler().clearAllKeys();
|
||||||
getInProgress().ifPresent(AbstractNodeCostSearch::cancel);
|
|
||||||
baritone.getInputOverrideHandler().getBlockBreakHelper().stopBreakingBlock();
|
baritone.getInputOverrideHandler().getBlockBreakHelper().stopBreakingBlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user