From: Juhu <5894800-Juhu_@users.noreply.gitlab.com>
Date: Mon, 6 Jul 2020 15:58:59 +0000 (+0200)
Subject: strafehud: little cleanup of jump height feature
X-Git-Tag: xonotic-v0.8.5~738^2~7
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5b2169f5543c458c677a59f6d787d575ecba67f7;p=xonotic%2Fxonotic-data.pk3dir.git

strafehud: little cleanup of jump height feature
---

diff --git a/qcsrc/client/hud/panel/strafehud.qc b/qcsrc/client/hud/panel/strafehud.qc
index 4a82c66d4..c72e59f2a 100644
--- a/qcsrc/client/hud/panel/strafehud.qc
+++ b/qcsrc/client/hud/panel/strafehud.qc
@@ -654,7 +654,7 @@ void HUD_StrafeHUD()
             startspeed = -1;
         }
 
-        // show height achieved by a single jump
+        // show height achieved by a single jump (doesn't work in low gravity)
         if(autocvar_hud_panel_strafehud_jumpheight_fade > 0)
         {
             float text_alpha = 0;
@@ -663,11 +663,7 @@ void HUD_StrafeHUD()
             float jumpspeed_current = strafeplayer.velocity.z;
             if(jumpspeed_prev <= jumpspeed_current || jumpheight_prev > jumpheight_current || IS_ONGROUND(strafeplayer) || swimming || IS_DEAD(strafeplayer) || spectating)
             {
-                if(IS_DEAD(strafeplayer) || spectating)
-                {
-                    jumpheight_prev = jumpheight_current;
-                    jumpspeed_prev = jumpspeed_current;
-                }
+                // doesn't catch spectating if the player instantaneously unspectates, would require to create a hook to for that (kill without respawn time seems to work fine)
                 jumprestart = true;
             }
             else