]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add patch from Juhu/strafehud-fixes branch: "strafehud: store current jumpheight...
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sun, 15 Jan 2023 14:08:25 +0000 (15:08 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sun, 15 Jan 2023 14:08:25 +0000 (15:08 +0100)
qcsrc/client/hud/panel/strafehud.qc

index 323a80066643a2b7d61c502882a55caae884b7ee..f8f26c4526b18afbc2ec9ae2583780ae9725977e 100644 (file)
@@ -1005,9 +1005,9 @@ void HUD_StrafeHUD()
             else if(strafeplayer.origin.z > height_max)
             {
                 height_max = strafeplayer.origin.z;
-                float jumpheight_new = (height_max - height_min) * length_conversion_factor;
+                float jumpheight_new = height_max - height_min;
 
-                if(jumpheight_new > max(autocvar_hud_panel_strafehud_jumpheight_min, 0))
+                if((jumpheight_new * length_conversion_factor) > max(autocvar_hud_panel_strafehud_jumpheight_min, 0))
                 {
                     jumpheight = jumpheight_new;
                     jumptime = time;
@@ -1036,7 +1036,7 @@ void HUD_StrafeHUD()
                 }
 
                 string length_unit = GetLengthUnit(autocvar_hud_panel_strafehud_unit);
-                drawstring_aspect(panel_pos - eY * (jumpheight_size.y + text_offset), strcat(ftos_decimals(jumpheight, length_decimals), autocvar_hud_panel_strafehud_unit_show ? length_unit : ""), jumpheight_size, autocvar_hud_panel_strafehud_jumpheight_color, text_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                drawstring_aspect(panel_pos - eY * (jumpheight_size.y + text_offset), strcat(ftos_decimals(jumpheight * length_conversion_factor, length_decimals), autocvar_hud_panel_strafehud_unit_show ? length_unit : ""), jumpheight_size, autocvar_hud_panel_strafehud_jumpheight_color, text_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
             }
             else
             {