From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Sun, 15 Jan 2023 13:59:35 +0000 (+0100) Subject: strafehud: store current jumpheight in qu and convert only for comparing and displaying X-Git-Tag: xonotic-v0.8.6~136^2~11 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=056a3158eabb1a3ff55526c55f5e9c259e7dc0f2;p=xonotic%2Fxonotic-data.pk3dir.git strafehud: store current jumpheight in qu and convert only for comparing and displaying --- diff --git a/qcsrc/client/hud/panel/strafehud.qc b/qcsrc/client/hud/panel/strafehud.qc index 692096575..d1f5c1c61 100644 --- a/qcsrc/client/hud/panel/strafehud.qc +++ b/qcsrc/client/hud/panel/strafehud.qc @@ -937,9 +937,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; @@ -968,7 +968,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 {