Update ETA formula, assuming heuritic at goal is 0

This commit is contained in:
ZacSharp 2020-09-04 23:56:01 +02:00
parent 35f3be9296
commit 303aa79ffb
No known key found for this signature in database
GPG Key ID: 9453647B005083A3

View File

@ -387,7 +387,7 @@ 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 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.empty();
} }
double eta = current * ticksElapsedSoFar / (start - current); double eta = Math.abs(current) * ticksElapsedSoFar / Math.abs(start - current);
if (eta < 0 || current < 0){ if (eta < 0 || current < 0){
return Optional.empty(); return Optional.empty();
} }