From 5eefa86d68a4360df8f551514c20068a9f6500aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20B=C3=B6klin?= Date: Sat, 23 Jan 2021 18:20:43 +0100 Subject: [PATCH] Fix glider stamina drain --- common/src/states/glide.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/common/src/states/glide.rs b/common/src/states/glide.rs index 2a7b729722..97f0b1bae3 100644 --- a/common/src/states/glide.rs +++ b/common/src/states/glide.rs @@ -56,14 +56,13 @@ impl CharacterBehavior for Data { let horiz_speed_sq = horiz_vel.magnitude_squared(); if horiz_speed_sq < GLIDE_SPEED.powi(2) && update.vel.0.z < 0.0 { let lift = (GLIDE_ANTIGRAV + update.vel.0.z.powi(2) * 0.15) - * (horiz_speed_sq * f32::powf(0.075, 2.0)).clamp(0.2, 1.0) - * data.dt.0; + * (horiz_speed_sq * f32::powf(0.075, 2.0)).clamp(0.2, 1.0); - update.vel.0.z += lift; + update.vel.0.z += lift * data.dt.0; // Expend energy during strenuous maneuvers. // Cost increases with lift exceeding that of calmly gliding. - let energy_cost = (10.0 * (lift - GLIDE_ANTIGRAV * data.dt.0)).max(0.0) as i32; + let energy_cost = (0.25 * (lift - GLIDE_ANTIGRAV)).max(0.0) as i32; if update .energy .try_change_by(-energy_cost, EnergySource::Glide)