fix: make fall damage behave correctly again after changing gravity

This commit is contained in:
timokoesters 2020-01-19 20:55:07 +01:00 committed by Pfauenauge90
parent 65d0a1c4f4
commit 6e651eb659
2 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@ fn integrate_forces(dt: f32, mut lv: Vec3<f32>, grav: f32, damp: f32) -> Vec3<f3
// must be interpolated accordingly
let linear_damp = (1.0 - damp.min(1.0)).powf(dt * 60.0);
lv.z = (lv.z - grav * dt).max(-50.0);
lv.z = (lv.z - grav * dt).max(-80.0);
lv * linear_damp
}

View File

@ -624,11 +624,11 @@ impl Server {
}
ServerEvent::LandOnGround { entity, vel } => {
if vel.z <= -25.0 {
if vel.z <= -37.0 {
if let Some(stats) =
state.ecs().write_storage::<comp::Stats>().get_mut(entity)
{
let falldmg = (vel.z / 5.0) as i32;
let falldmg = (vel.z / 2.5) as i32;
if falldmg < 0 {
stats.health.change_by(comp::HealthChange {
amount: falldmg,