aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/pathfinder/mod.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2024-12-24 05:18:33 +0000
committermat <git@matdoes.dev>2024-12-24 05:18:33 +0000
commitde5a53ce08de5b9d77bce99dd9ecde3171ebd74e (patch)
tree02c84b356f8dc20ea882793001dd229adfa02121 /azalea/src/pathfinder/mod.rs
parent958848e8ed10c7b8a83c9faea1fac6eaac39b018 (diff)
downloadazalea-drasl-de5a53ce08de5b9d77bce99dd9ecde3171ebd74e.tar.xz
add additional pathfinder test and fix pathfinder failure
Diffstat (limited to 'azalea/src/pathfinder/mod.rs')
-rw-r--r--azalea/src/pathfinder/mod.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs
index 802d9ebd..b82b5f84 100644
--- a/azalea/src/pathfinder/mod.rs
+++ b/azalea/src/pathfinder/mod.rs
@@ -945,6 +945,7 @@ mod tests {
// simulation.app.add_plugins(bevy_log::LogPlugin {
// level: bevy_log::Level::TRACE,
// filter: "".to_string(),
+ // ..Default::default()
// });
simulation.app.world_mut().send_event(GotoEvent {
@@ -1153,4 +1154,24 @@ mod tests {
);
assert_simulation_reaches(&mut simulation, 80, BlockPos::new(4, 71, 12));
}
+
+ #[test]
+ fn test_jumps_with_more_sideways_momentum() {
+ let mut partial_chunks = PartialChunkStorage::default();
+ let mut simulation = setup_blockposgoal_simulation(
+ &mut partial_chunks,
+ BlockPos::new(0, 71, 0),
+ BlockPos::new(2, 74, 9),
+ vec![
+ BlockPos::new(0, 70, 0),
+ BlockPos::new(0, 70, 1),
+ BlockPos::new(0, 70, 2),
+ BlockPos::new(0, 71, 3),
+ BlockPos::new(0, 72, 6),
+ BlockPos::new(0, 73, 9),
+ BlockPos::new(2, 73, 9),
+ ],
+ );
+ assert_simulation_reaches(&mut simulation, 80, BlockPos::new(2, 74, 9));
+ }
}