misc improvements

This commit is contained in:
Leijurv 2018-09-10 09:22:32 -07:00
parent 075ad3f244
commit 72eec135d0
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
3 changed files with 9 additions and 2 deletions

View File

@ -158,8 +158,8 @@ public class AStarPathFinder extends AbstractNodeCostSearch implements Helper {
if (neighbor.isOpen) {
openSet.update(neighbor);
} else {
openSet.insert(neighbor);//dont double count, dont insert into open set if it's already there
neighbor.isOpen = true;
openSet.insert(neighbor);//dont double count, dont insert into open set if it's already there
}
for (int i = 0; i < bestSoFar.length; i++) {
double heuristic = neighbor.estimatedCostToGoal + neighbor.cost / COEFFICIENTS[i];

View File

@ -18,6 +18,7 @@
package baritone.pathing.calc;
import baritone.pathing.goals.Goal;
import baritone.pathing.movement.ActionCosts;
import baritone.pathing.movement.Movement;
import baritone.utils.pathing.BetterBlockPos;
@ -81,7 +82,7 @@ public final class PathNode {
public PathNode(BetterBlockPos pos, Goal goal) {
this.pos = pos;
this.previous = null;
this.cost = Short.MAX_VALUE;
this.cost = ActionCosts.COST_INF;
this.goal = goal;
this.estimatedCostToGoal = goal.heuristic(pos);
this.previousMovement = null;

View File

@ -65,6 +65,12 @@ public class MovementParkour extends Movement {
if (!MovementHelper.fullyPassable(src.up().offset(dir))) {
return null;
}
if (!MovementHelper.fullyPassable(src.up(2).offset(dir))) {
return null;
}
if (!MovementHelper.fullyPassable(src.up(2))) {
return null;
}
for (int i = 2; i <= 4; i++) {
BlockPos dest = src.offset(dir, i);
// TODO perhaps dest.up(3) doesn't need to be fullyPassable, just canWalkThrough, possibly?