mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 14:26:04 +00:00
fix pathfinder descending onto non-full blocks
This commit is contained in:
parent
7b442368da
commit
685aeff13f
1 changed files with 9 additions and 2 deletions
|
@ -324,6 +324,7 @@ pub fn descend_is_reached(
|
||||||
target,
|
target,
|
||||||
start,
|
start,
|
||||||
position,
|
position,
|
||||||
|
physics,
|
||||||
..
|
..
|
||||||
}: IsReachedCtx,
|
}: IsReachedCtx,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
|
@ -333,8 +334,14 @@ pub fn descend_is_reached(
|
||||||
start.z + (target.z - start.z) * 2,
|
start.z + (target.z - start.z) * 2,
|
||||||
);
|
);
|
||||||
|
|
||||||
(BlockPos::from(position) == target || BlockPos::from(position) == dest_ahead)
|
if BlockPos::from(position) == target || BlockPos::from(position) == dest_ahead {
|
||||||
&& (position.y - target.y as f64) < 0.5
|
if (position.y - target.y as f64) < 0.5 {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else if BlockPos::from(position).up(1) == target && physics.on_ground() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
fn descend_forward_1_move(ctx: &mut PathfinderCtx, pos: RelBlockPos) {
|
fn descend_forward_1_move(ctx: &mut PathfinderCtx, pos: RelBlockPos) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue