add a method to get the heuristic at the goal
this alows the ETA to work with goals not ending with a heuristic of 0 GoalComposite, GoalRunAway and GoalNear are still missing
This commit is contained in:
@@ -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
|
||||
return Optional.empty();
|
||||
}
|
||||
double eta = Math.abs(current) * ticksElapsedSoFar / Math.abs(start - current);
|
||||
double eta = Math.abs(current - goal.heuristic()) * ticksElapsedSoFar / Math.abs(start - current);
|
||||
return Optional.of(eta);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user