simplify icky code

This commit is contained in:
Babbaj 2023-07-17 18:16:09 -04:00
parent afe9359d3e
commit 2f0497756b
No known key found for this signature in database
GPG Key ID: F044309848A07CAC
1 changed files with 2 additions and 8 deletions

View File

@ -70,13 +70,6 @@ public class ElytraProcess extends BaritoneProcessHelper implements IBaritonePro
@Override
public PathingCommand onTick(boolean calcFailed, boolean isSafeToCancel) {
IBaritoneProcess procLastTick = baritone.getPathingControlManager().mostRecentInControl().orElse(null);
// this is true if the pause process was running or any other processes that causes us to not tick
skippedThisTick = procLastTick != null && procLastTick.priority() > this.priority();
if (skippedThisTick) {
return new PathingCommand(null, PathingCommandType.DEFER);
}
this.behavior.onTick();
if (calcFailed) {
onLostControl();
@ -292,6 +285,7 @@ public class ElytraProcess extends BaritoneProcessHelper implements IBaritonePro
@Override
public void onPostTick(TickEvent event) {
if (this.behavior != null && !skippedThisTick) this.behavior.onPostTick(event);
IBaritoneProcess procThisTick = baritone.getPathingControlManager().mostRecentInControl().orElse(null);
if (this.behavior != null && procThisTick == this) this.behavior.onPostTick(event);
}
}