From 3cb19848927be686239d09b5e320cd03f796b4dd Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sun, 2 Dec 2018 19:40:23 -0800 Subject: [PATCH] only apply static cutoff to protrusion beyond min length --- src/main/java/baritone/utils/pathing/PathBase.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/baritone/utils/pathing/PathBase.java b/src/main/java/baritone/utils/pathing/PathBase.java index aaf36895..15d0e7bc 100644 --- a/src/main/java/baritone/utils/pathing/PathBase.java +++ b/src/main/java/baritone/utils/pathing/PathBase.java @@ -39,14 +39,15 @@ public abstract class PathBase implements IPath { @Override public IPath staticCutoff(Goal destination) { - if (length() < BaritoneAPI.getSettings().pathCutoffMinimumLength.get()) { + int min = BaritoneAPI.getSettings().pathCutoffMinimumLength.get(); + if (length() < min) { return this; } if (destination == null || destination.isInGoal(getDest())) { return this; } double factor = BaritoneAPI.getSettings().pathCutoffFactor.get(); - int newLength = (int) ((length() - 1) * factor); + int newLength = (int) ((length() - 1 - min) * factor) + min; return new CutoffPath(this, newLength); } }