diff options
| author | mat <git@matdoes.dev> | 2023-10-07 17:45:34 -0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-10-07 17:45:34 -0500 |
| commit | 9281e4fdb96fda7cef383e10611029c45538fbf2 (patch) | |
| tree | 2a74a585a23d3469d5fd97bbd32d95a755973be5 /azalea/src | |
| parent | 44fda05893f5a3b95822b796fd0148d990f4c631 (diff) | |
| download | azalea-drasl-9281e4fdb96fda7cef383e10611029c45538fbf2.tar.xz | |
fix some parkour issues
Diffstat (limited to 'azalea/src')
| -rw-r--r-- | azalea/src/pathfinder/moves/parkour.rs | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/azalea/src/pathfinder/moves/parkour.rs b/azalea/src/pathfinder/moves/parkour.rs index dc7518d7..617333c8 100644 --- a/azalea/src/pathfinder/moves/parkour.rs +++ b/azalea/src/pathfinder/moves/parkour.rs @@ -48,7 +48,7 @@ fn parkour_forward_1_move(edges: &mut Vec<Edge>, ctx: &PathfinderCtx, pos: Block continue; } - let cost = JUMP_PENALTY + WALK_ONE_BLOCK_COST * 2.; + let cost = JUMP_PENALTY + WALK_ONE_BLOCK_COST * 2. + CENTER_AFTER_FALL_COST; edges.push(Edge { movement: astar::Movement { @@ -102,7 +102,7 @@ fn parkour_forward_2_move(edges: &mut Vec<Edge>, ctx: &PathfinderCtx, pos: Block continue; } - let cost = JUMP_PENALTY + WALK_ONE_BLOCK_COST * 3.; + let cost = JUMP_PENALTY + WALK_ONE_BLOCK_COST * 3. + CENTER_AFTER_FALL_COST; edges.push(Edge { movement: astar::Movement { @@ -132,11 +132,7 @@ fn parkour_forward_3_move(edges: &mut Vec<Edge>, ctx: &PathfinderCtx, pos: Block continue; } - let ascend: i32 = if ctx.is_standable(pos + offset.up(1)) { - 1 - } else if ctx.is_standable(pos + offset) { - 0 - } else { + if !ctx.is_standable(pos + offset) { continue; }; @@ -158,11 +154,11 @@ fn parkour_forward_3_move(edges: &mut Vec<Edge>, ctx: &PathfinderCtx, pos: Block continue; } - let cost = JUMP_PENALTY + WALK_ONE_BLOCK_COST * 3.; + let cost = JUMP_PENALTY + SPRINT_ONE_BLOCK_COST * 4. + CENTER_AFTER_FALL_COST; edges.push(Edge { movement: astar::Movement { - target: pos + offset.up(ascend), + target: pos + offset, data: MoveData { execute: &execute_parkour_move, is_reached: &default_is_reached, @@ -237,8 +233,6 @@ pub fn parkour_is_reached( position, target, .. }: IsReachedCtx, ) -> bool { - let target_center = target.center(); - // 0.094 and not 0 for lilypads BlockPos::from(position) == target && (position.y - target.y as f64) < 0.094 } |
