diff --git a/common/systems/src/phys.rs b/common/systems/src/phys.rs index 6a53083b25..a148311385 100644 --- a/common/systems/src/phys.rs +++ b/common/systems/src/phys.rs @@ -1605,10 +1605,6 @@ fn box_voxel_collision + ReadVol>( on_ceiling = true; } - if resolve_dir.magnitude_squared() > 0.0 { - land_on_ground(entity, *vel, resolve_dir.normalized()); - } - // When the resolution direction is non-vertical, we must be colliding // with a wall // @@ -1652,7 +1648,10 @@ fn box_voxel_collision + ReadVol>( break; } - // If not, correct the velocity + // If not, correct the velocity, applying collision damage as we do + if resolve_dir.magnitude_squared() > 0.0 { + land_on_ground(entity, *vel, resolve_dir.normalized()); + } vel.0 = vel.0.map2( resolve_dir, |e, d| { diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index e4f5212c43..2af58712c1 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -603,7 +603,18 @@ pub fn handle_land_on_ground( ) { let ecs = server.state.ecs(); - let relative_vel = vel.dot(-surface_normal); + // HACK: Certain ability movements currently take up above the fall damage + // threshold in the horizontal axis. This factor dampens velocity in the + // horizontal axis when applying fall damage. + let horizontal_damp = 0.5 + + vel + .try_normalized() + .unwrap_or_default() + .dot(Vec3::unit_z()) + .abs() + * 0.5; + + let relative_vel = vel.dot(-surface_normal) * horizontal_damp; // The second part of this if statement disables all fall damage when in the // water. This was added as a *temporary* fix a bug that causes you to take