misc improvements
This commit is contained in:
parent
075ad3f244
commit
72eec135d0
@ -158,8 +158,8 @@ public class AStarPathFinder extends AbstractNodeCostSearch implements Helper {
|
|||||||
if (neighbor.isOpen) {
|
if (neighbor.isOpen) {
|
||||||
openSet.update(neighbor);
|
openSet.update(neighbor);
|
||||||
} else {
|
} else {
|
||||||
openSet.insert(neighbor);//dont double count, dont insert into open set if it's already there
|
|
||||||
neighbor.isOpen = true;
|
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++) {
|
for (int i = 0; i < bestSoFar.length; i++) {
|
||||||
double heuristic = neighbor.estimatedCostToGoal + neighbor.cost / COEFFICIENTS[i];
|
double heuristic = neighbor.estimatedCostToGoal + neighbor.cost / COEFFICIENTS[i];
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
package baritone.pathing.calc;
|
package baritone.pathing.calc;
|
||||||
|
|
||||||
import baritone.pathing.goals.Goal;
|
import baritone.pathing.goals.Goal;
|
||||||
|
import baritone.pathing.movement.ActionCosts;
|
||||||
import baritone.pathing.movement.Movement;
|
import baritone.pathing.movement.Movement;
|
||||||
import baritone.utils.pathing.BetterBlockPos;
|
import baritone.utils.pathing.BetterBlockPos;
|
||||||
|
|
||||||
@ -81,7 +82,7 @@ public final class PathNode {
|
|||||||
public PathNode(BetterBlockPos pos, Goal goal) {
|
public PathNode(BetterBlockPos pos, Goal goal) {
|
||||||
this.pos = pos;
|
this.pos = pos;
|
||||||
this.previous = null;
|
this.previous = null;
|
||||||
this.cost = Short.MAX_VALUE;
|
this.cost = ActionCosts.COST_INF;
|
||||||
this.goal = goal;
|
this.goal = goal;
|
||||||
this.estimatedCostToGoal = goal.heuristic(pos);
|
this.estimatedCostToGoal = goal.heuristic(pos);
|
||||||
this.previousMovement = null;
|
this.previousMovement = null;
|
||||||
|
@ -65,6 +65,12 @@ public class MovementParkour extends Movement {
|
|||||||
if (!MovementHelper.fullyPassable(src.up().offset(dir))) {
|
if (!MovementHelper.fullyPassable(src.up().offset(dir))) {
|
||||||
return null;
|
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++) {
|
for (int i = 2; i <= 4; i++) {
|
||||||
BlockPos dest = src.offset(dir, i);
|
BlockPos dest = src.offset(dir, i);
|
||||||
// TODO perhaps dest.up(3) doesn't need to be fullyPassable, just canWalkThrough, possibly?
|
// TODO perhaps dest.up(3) doesn't need to be fullyPassable, just canWalkThrough, possibly?
|
||||||
|
Loading…
Reference in New Issue
Block a user