From 557d165f22b318ad493d401bb791f1c10b4dd976 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Fri, 12 Mar 2021 22:45:29 +0000 Subject: [PATCH] Prevented block-snapping too eagerly --- common/sys/src/phys.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/common/sys/src/phys.rs b/common/sys/src/phys.rs index d091155428..62063f3e41 100644 --- a/common/sys/src/phys.rs +++ b/common/sys/src/phys.rs @@ -1002,17 +1002,9 @@ fn cylinder_voxel_collision<'a, T: BaseVol + ReadVol>( near_iter.clone(), radius, z_range.clone(), - ) && vel.0.z < 0.1 + ) && vel.0.z < 0.5 && vel.0.z > -1.5 - // && was_on_ground - // && !collision_with( - // pos.0 - Vec3::unit_z() * 0.0, - // &terrain, - // |block| block.solid_height() >= (pos.0.z - 0.1).rem_euclid(1.0), - // near_iter.clone(), - // radius, - // z_range.clone(), - // ) + && was_on_ground { let snap_height = terrain .get(Vec3::new(pos.0.x, pos.0.y, pos.0.z - 0.1).map(|e| e.floor() as i32))