From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Mon, 6 Jul 2020 01:27:47 +0000 (+0200) Subject: strafehud: properly prevent jump height being carried over after respawn X-Git-Tag: xonotic-v0.8.5~738^2~11 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c3b1dd924f7a88e5df2afc298e7e6777cacba2e0;p=xonotic%2Fxonotic-data.pk3dir.git strafehud: properly prevent jump height being carried over after respawn --- diff --git a/qcsrc/client/hud/panel/strafehud.qc b/qcsrc/client/hud/panel/strafehud.qc index 8e0ebfdbf..30322a2fc 100644 --- a/qcsrc/client/hud/panel/strafehud.qc +++ b/qcsrc/client/hud/panel/strafehud.qc @@ -4,6 +4,7 @@ #include #include +#include #include #include #include @@ -659,8 +660,13 @@ void HUD_StrafeHUD() float jumpheight_min = max(autocvar_hud_panel_strafehud_jumpheight_min * length_conversion_factor, 0); float jumpheight_current = strafeplayer.origin.z; float jumpspeed_current = strafeplayer.velocity.z; - if(jumpspeed_prev <= jumpspeed_current || jumpheight_prev > jumpheight_current || IS_ONGROUND(strafeplayer) || swimming) + if(jumpspeed_prev <= jumpspeed_current || jumpheight_prev > jumpheight_current || IS_ONGROUND(strafeplayer) || swimming || IS_DEAD(strafeplayer)) { + if(IS_DEAD(strafeplayer)) + { + jumpheight_prev = jumpheight_current; + jumpspeed_prev = jumpspeed_current; + } jumprestart = true; } else @@ -669,9 +675,6 @@ void HUD_StrafeHUD() { jumprestart = false; jumpheight = 0; - // this reduces accuracy a little bit but prevents all kind of bugs from carryover values at connect or when dying - jumpheight_prev = jumpheight_current; - jumpspeed_prev = jumpspeed_current; } else {