]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix onground detection in spectate mode
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Mon, 4 May 2020 23:33:55 +0000 (01:33 +0200)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Mon, 4 May 2020 23:33:55 +0000 (01:33 +0200)
qcsrc/client/hud/panel/strafehud.qc

index c8557052f099c2ba065b3fc84532c40807e4837e..4ba4634fea0e4b716a5a1512fdfe06e36164f31b 100644 (file)
@@ -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 <client/autocvars.qh>
@@ -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;