diff --git a/common/sys/src/phys.rs b/common/sys/src/phys.rs index dc559ffb51..e45a5a766c 100644 --- a/common/sys/src/phys.rs +++ b/common/sys/src/phys.rs @@ -42,6 +42,11 @@ pub const FRIC_FLUID: f32 = 0.4; // damp = linear damping // Friction is a type of damping. fn integrate_forces(dt: f32, mut lv: Vec3, grav: f32, damp: f32) -> Vec3 { + // Clamp dt to an effective 10 TPS, to prevent gravity from slamming the players + // into the floor when stationary if other systems cause the server to lag + // (as observed in the 0.9 release party). + let dt = dt.min(0.1); + // this is not linear damping, because it is proportional to the original // velocity this "linear" damping in in fact, quite exponential. and thus // must be interpolated accordingly diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index 92a847a73c..ca93b54afc 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -509,7 +509,7 @@ pub fn handle_delete(server: &mut Server, entity: EcsEntity) { pub fn handle_land_on_ground(server: &Server, entity: EcsEntity, vel: Vec3) { let state = &server.state; if vel.z <= -30.0 { - let falldmg = (vel.z.powi(2) / 20.0 - 40.0) * 10.0; + let falldmg = (vel.z.powi(2) / 20.0 - 40.0) * 7.5; let inventories = state.ecs().read_storage::(); let stats = state.ecs().read_storage::(); // Handle health change