mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'falldamage-20210320' into 'master'
Update fall damage calculations. See merge request veloren/veloren!1954
This commit is contained in:
commit
a62f2ab133
@ -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<f32>, grav: f32, damp: f32) -> Vec3<f32> {
|
||||
// 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
|
||||
|
@ -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<f32>) {
|
||||
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::<Inventory>();
|
||||
let stats = state.ecs().read_storage::<Stats>();
|
||||
// Handle health change
|
||||
|
Loading…
Reference in New Issue
Block a user