From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Mon, 4 May 2020 23:33:55 +0000 (+0200) Subject: fix onground detection in spectate mode X-Git-Tag: xonotic-v0.8.5~738^2~77 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9cbb457ffd807273600af345ea9b04c89ded6ab5;p=xonotic%2Fxonotic-data.pk3dir.git fix onground detection in spectate mode --- diff --git a/qcsrc/client/hud/panel/strafehud.qc b/qcsrc/client/hud/panel/strafehud.qc index c8557052f..4ba4634fe 100644 --- a/qcsrc/client/hud/panel/strafehud.qc +++ b/qcsrc/client/hud/panel/strafehud.qc @@ -1,8 +1,6 @@ // Name: StrafeHUD // Author: Juhu -// FIXME: strafehud doesn't work properly in spectate due to lack of IS_ONGROUND() - #include "strafehud.qh" #include @@ -76,7 +74,7 @@ void HUD_StrafeHUD() float strafehud_indicator_minspeed = autocvar_hud_panel_strafehud_indicator_minspeed; // physics - float strafehud_onground = IS_ONGROUND(strafeplayer); + float strafehud_onground = strafeplayer == csqcplayer ? IS_ONGROUND(strafeplayer) : !(strafeplayer.anim_implicit_state & ANIMIMPLICITSTATE_INAIR); float strafehud_speed = !autocvar__hud_configure ? vlen(vec2(csqcplayer.velocity)) : 1337; // use local csqcmodel entity for this even when spectating, flickers too much otherwise float strafehud_maxspeed_crouch_mod = IS_DUCKED(strafeplayer) ? .5 : 1; float strafehud_maxspeed_swamp_mod = strafeplayer.in_swamp ? strafeplayer.swamp_slowdown : 1;