fix failure on repeated descend

This commit is contained in:
Leijurv 2018-10-01 15:42:16 -07:00
parent 8f146d1a2b
commit 07eee481cb
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -111,7 +111,7 @@ public class PathExecutor implements Helper {
for (int j = pathPosition; j <= previousPos; j++) {
path.movements().get(j).reset();
}
clearKeys();
onChangeInPathPosition();
return false;
}
}
@ -122,7 +122,7 @@ public class PathExecutor implements Helper {
}
System.out.println("Double skip sundae");
pathPosition = i - 1;
clearKeys();
onChangeInPathPosition();
return false;
}
}
@ -251,8 +251,7 @@ public class PathExecutor implements Helper {
if (movementStatus == SUCCESS) {
//System.out.println("Movement done, next path");
pathPosition++;
ticksOnCurrent = 0;
clearKeys();
onChangeInPathPosition();
onTick(event);
return true;
} else {
@ -328,13 +327,14 @@ public class PathExecutor implements Helper {
player().setSprinting(true);
}
pathPosition++;
// okay to skip clearKeys and / or onChangeInPathPosition here since this isn't possible to repeat, since it's asymmetric
logDebug("Skipping descend to straight ascend");
return;
}
if (canSprintInto(current, next)) {
if (playerFeet().equals(current.getDest())) {
pathPosition++;
clearKeys();
onChangeInPathPosition();
}
if (!player().isSprinting()) {
player().setSprinting(true);
@ -376,6 +376,11 @@ public class PathExecutor implements Helper {
return false;
}
private void onChangeInPathPosition() {
clearKeys();
ticksOnCurrent = 0;
}
private static void clearKeys() {
// i'm just sick and tired of this snippet being everywhere lol
Baritone.INSTANCE.getInputOverrideHandler().clearAllKeys();