Prevented block-snapping too eagerly

This commit is contained in:
Joshua Barretto 2021-03-12 22:45:29 +00:00
parent e7c41964c0
commit 557d165f22

View File

@ -1002,17 +1002,9 @@ fn cylinder_voxel_collision<'a, T: BaseVol<Vox = Block> + ReadVol>(
near_iter.clone(), near_iter.clone(),
radius, radius,
z_range.clone(), z_range.clone(),
) && vel.0.z < 0.1 ) && vel.0.z < 0.5
&& vel.0.z > -1.5 && vel.0.z > -1.5
// && was_on_ground && 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(),
// )
{ {
let snap_height = terrain let snap_height = terrain
.get(Vec3::new(pos.0.x, pos.0.y, pos.0.z - 0.1).map(|e| e.floor() as i32)) .get(Vec3::new(pos.0.x, pos.0.y, pos.0.z - 0.1).map(|e| e.floor() as i32))