Skip to content

Commit 886dcf4

Browse files
committed
Show position of movements with nonsensical cost
1 parent a7f87df commit 886dcf4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/baritone/pathing/calc/AStarPathFinder.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ protected Optional<IPath> calculate0(long primaryTimeout, long failureTimeout) {
122122
continue;
123123
}
124124
if (actionCost <= 0 || Double.isNaN(actionCost)) {
125-
throw new IllegalStateException(moves + " calculated implausible cost " + actionCost);
125+
throw new IllegalStateException(String.format(
126+
"%s from %s %s %s calculated implausible cost %s",
127+
moves, currentNode.x, currentNode.y, currentNode.z, actionCost));
126128
}
127129
// check destination after verifying it's not COST_INF -- some movements return a static IMPOSSIBLE object with COST_INF and destination being 0,0,0 to avoid allocating a new result for every failed calculation
128130
if (moves.dynamicXZ && !worldBorder.entirelyContains(res.x, res.z)) { // see issue #218

0 commit comments

Comments
 (0)