mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
fix: make fall damage behave correctly again after changing gravity
This commit is contained in:
parent
1912ab0d8b
commit
a708ab84d6
@ -33,7 +33,7 @@ fn integrate_forces(dt: f32, mut lv: Vec3<f32>, grav: f32, damp: f32) -> Vec3<f3
|
|||||||
// must be interpolated accordingly
|
// must be interpolated accordingly
|
||||||
let linear_damp = (1.0 - damp.min(1.0)).powf(dt * 60.0);
|
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
|
lv * linear_damp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,11 +624,11 @@ impl Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ServerEvent::LandOnGround { entity, vel } => {
|
ServerEvent::LandOnGround { entity, vel } => {
|
||||||
if vel.z <= -25.0 {
|
if vel.z <= -37.0 {
|
||||||
if let Some(stats) =
|
if let Some(stats) =
|
||||||
state.ecs().write_storage::<comp::Stats>().get_mut(entity)
|
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 {
|
if falldmg < 0 {
|
||||||
stats.health.change_by(comp::HealthChange {
|
stats.health.change_by(comp::HealthChange {
|
||||||
amount: falldmg,
|
amount: falldmg,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user