get rid of negative ETAs the lazy way
This commit is contained in:
parent
695954bdb0
commit
35f3be9296
@ -387,7 +387,11 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior,
|
||||
if (current == start) {//can't check above because current and start can be equal even if currentPos and startPosition are not
|
||||
return Optional.empty();
|
||||
}
|
||||
return Optional.of(current * ticksElapsedSoFar / (start - current));
|
||||
double eta = current * ticksElapsedSoFar / (start - current);
|
||||
if (eta < 0 || current < 0){
|
||||
return Optional.empty();
|
||||
}
|
||||
return Optional.of(eta);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user