]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
strafehud: properly pass player entity to vangle function for use in macro even thoug...
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Thu, 26 Sep 2024 16:59:05 +0000 (18:59 +0200)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Thu, 26 Sep 2024 16:59:59 +0000 (18:59 +0200)
qcsrc/client/hud/panel/strafehud.qc
qcsrc/client/hud/panel/strafehud/extra.qc
qcsrc/client/hud/panel/strafehud/extra.qh

index 1b385f39be6e8bb42c77b36f6923322b23d220ed..6d6198a1c3e629025cf9014ee58b4b56c50da328 100644 (file)
@@ -741,7 +741,7 @@ void HUD_StrafeHUD()
                }
        }
 
-       text_offset_bottom += StrafeHUD_DrawVerticalAngle(text_offset_bottom);
+       text_offset_bottom += StrafeHUD_DrawVerticalAngle(strafeplayer, text_offset_bottom);
 
        draw_beginBoldFont();
        text_offset_bottom += StrafeHUD_DrawStartSpeed(speed, text_offset_bottom);
index c82ecb51d51c903bea620fb254c30d9ae482a792..7651e7157a443a175effb617f8cabc9b23e4b422 100644 (file)
@@ -101,11 +101,11 @@ float StrafeHUD_DrawSlickDetector(entity e, bool onslick)
 }
 
 // vertical angle for weapon jumps
-float StrafeHUD_DrawVerticalAngle(float text_offset_bottom)
+float StrafeHUD_DrawVerticalAngle(entity e, float text_offset_bottom)
 {
        if(autocvar_hud_panel_strafehud_vangle)
        {
-               float vangle = -PHYS_INPUT_ANGLES(strafeplayer).x;
+               float vangle = -PHYS_INPUT_ANGLES(e).x;
                float vangle_height = autocvar_hud_panel_strafehud_vangle_size * panel_size.y;
                string vangle_text = strcat(ftos_decimals(vangle, 2), "°");
 
index eab553e78fb0ff511e9c6551a5bcd722fb664f82..079ad31a592242dd26e2e36c8cc4c31af589b0db 100644 (file)
@@ -2,7 +2,7 @@
 #include "../strafehud.qh"
 
 float StrafeHUD_DrawSlickDetector(entity, bool);
-float StrafeHUD_DrawVerticalAngle(float);
+float StrafeHUD_DrawVerticalAngle(entity, float);
 void StrafeHUD_Sonar(float, string);
 string StrafeHUD_UpdateSonarSound();
 float StrafeHUD_DrawJumpHeight(entity, bool, bool, float);