]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Small cleanup
authorterencehill <piuntn@gmail.com>
Sun, 29 May 2022 23:00:34 +0000 (01:00 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 29 May 2022 23:00:34 +0000 (01:00 +0200)
qcsrc/client/hud/crosshair.qc
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/view.qc

index cf2c01d971f134ec41ca51d1e04e175c83c9cf00..229a6024084df01cbabefa97a02de385a558a86a 100644 (file)
@@ -63,9 +63,8 @@ float EnemyHitCheck()
        if(n > maxclients)
                return SHOTTYPE_HITWORLD;
        t = entcs_GetTeam(n - 1);
-       if(teamplay)
-               if(t == myteam)
-                       return SHOTTYPE_HITTEAM;
+       if(teamplay && t == myteam)
+               return SHOTTYPE_HITTEAM;
        if(t == NUM_SPECTATOR)
                return SHOTTYPE_HITWORLD;
        return SHOTTYPE_HITENEMY;
index ed8715e022909cd1545784a29c222d3d1d130c92..0d0a44b6a295f839a7516ac210f96a685edee8bc 100644 (file)
@@ -2110,8 +2110,7 @@ void Scoreboard_Draw()
 
        // print information about respawn status
        float respawn_time = STAT(RESPAWN_TIME);
-       if(!intermission)
-       if(respawn_time)
+       if(!intermission && respawn_time)
        {
                if(respawn_time < 0)
                {
index 855d20f818fbf7d04028cd255ec5067f42ab25f8..a183c82d0ad04e2482cf522e73b94399d596cffd 100644 (file)
@@ -868,41 +868,46 @@ void HUD_Draw(entity this)
        Hud_Dynamic_Frame();
 
        if(!intermission)
-       if (MUTATOR_CALLHOOK(HUD_Draw_overlay))
        {
-               drawfill('0 0 0', vec2(vid_conwidth, vid_conheight), M_ARGV(0, vector), autocvar_hud_colorflash_alpha * M_ARGV(1, float), DRAWFLAG_ADDITIVE);
-       }
-       else if(STAT(FROZEN))
-       {
-               vector col = '0.25 0.90 1';
-               float col_fade = max(0, STAT(REVIVE_PROGRESS) * 2 - 1);
-               float alpha_fade = 0.3 + 0.7 * (1 - max(0, STAT(REVIVE_PROGRESS) * 4 - 3));
-               if(col_fade)
-                       col += vec3(col_fade, -col_fade, -col_fade);
-               drawfill('0 0 0', vec2(vid_conwidth, vid_conheight), col, autocvar_hud_colorflash_alpha * alpha_fade, DRAWFLAG_ADDITIVE);
+               if (MUTATOR_CALLHOOK(HUD_Draw_overlay))
+               {
+                       drawfill('0 0 0', vec2(vid_conwidth, vid_conheight), M_ARGV(0, vector), autocvar_hud_colorflash_alpha * M_ARGV(1, float), DRAWFLAG_ADDITIVE);
+               }
+               else if(STAT(FROZEN))
+               {
+                       vector col = '0.25 0.90 1';
+                       float col_fade = max(0, STAT(REVIVE_PROGRESS) * 2 - 1);
+                       float alpha_fade = 0.3 + 0.7 * (1 - max(0, STAT(REVIVE_PROGRESS) * 4 - 3));
+                       if(col_fade)
+                               col += vec3(col_fade, -col_fade, -col_fade);
+                       drawfill('0 0 0', vec2(vid_conwidth, vid_conheight), col, autocvar_hud_colorflash_alpha * alpha_fade, DRAWFLAG_ADDITIVE);
+               }
        }
 
        HUD_Scale_Enable();
        if(!intermission)
-       if(STAT(NADE_TIMER) && autocvar_cl_nade_timer) // give nade top priority, as it's a matter of life and death
-       {
-               vector col = '0.25 0.90 1' + vec3(STAT(NADE_TIMER), -STAT(NADE_TIMER), -STAT(NADE_TIMER));
-               DrawCircleClippedPic(vec2(0.5 * vid_conwidth, 0.6 * vid_conheight), 0.1 * vid_conheight, "gfx/crosshair_ring", STAT(NADE_TIMER), col, autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
-               drawstring_aspect(eY * 0.64 * vid_conheight, ((autocvar_cl_nade_timer == 2) ? _("Nade timer") : ""), vec2(vid_conwidth, 0.025 * vid_conheight), '1 1 1', 1, DRAWFLAG_NORMAL);
-       }
-       else if(STAT(CAPTURE_PROGRESS))
-       {
-               DrawCircleClippedPic(vec2(0.5 * vid_conwidth, 0.6 * vid_conheight), 0.1 * vid_conheight, "gfx/crosshair_ring", STAT(CAPTURE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
-               drawstring_aspect(eY * 0.64 * vid_conheight, _("Capture progress"), vec2(vid_conwidth, 0.025 * vid_conheight), '1 1 1', 1, DRAWFLAG_NORMAL);
-       }
-       else if(STAT(REVIVE_PROGRESS))
        {
-               DrawCircleClippedPic(vec2(0.5 * vid_conwidth, 0.6 * vid_conheight), 0.1 * vid_conheight, "gfx/crosshair_ring", STAT(REVIVE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
-               drawstring_aspect(eY * 0.64 * vid_conheight, _("Revival progress"), vec2(vid_conwidth, 0.025 * vid_conheight), '1 1 1', 1, DRAWFLAG_NORMAL);
+               if(STAT(NADE_TIMER) && autocvar_cl_nade_timer) // give nade top priority, as it's a matter of life and death
+               {
+                       vector col = '0.25 0.90 1' + vec3(STAT(NADE_TIMER), -STAT(NADE_TIMER), -STAT(NADE_TIMER));
+                       DrawCircleClippedPic(vec2(0.5 * vid_conwidth, 0.6 * vid_conheight), 0.1 * vid_conheight, "gfx/crosshair_ring", STAT(NADE_TIMER), col, autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
+                       drawstring_aspect(eY * 0.64 * vid_conheight, ((autocvar_cl_nade_timer == 2) ? _("Nade timer") : ""), vec2(vid_conwidth, 0.025 * vid_conheight), '1 1 1', 1, DRAWFLAG_NORMAL);
+               }
+               else if(STAT(CAPTURE_PROGRESS))
+               {
+                       DrawCircleClippedPic(vec2(0.5 * vid_conwidth, 0.6 * vid_conheight), 0.1 * vid_conheight, "gfx/crosshair_ring", STAT(CAPTURE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
+                       drawstring_aspect(eY * 0.64 * vid_conheight, _("Capture progress"), vec2(vid_conwidth, 0.025 * vid_conheight), '1 1 1', 1, DRAWFLAG_NORMAL);
+               }
+               else if(STAT(REVIVE_PROGRESS))
+               {
+                       DrawCircleClippedPic(vec2(0.5 * vid_conwidth, 0.6 * vid_conheight), 0.1 * vid_conheight, "gfx/crosshair_ring", STAT(REVIVE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
+                       drawstring_aspect(eY * 0.64 * vid_conheight, _("Revival progress"), vec2(vid_conwidth, 0.025 * vid_conheight), '1 1 1', 1, DRAWFLAG_NORMAL);
+               }
        }
        HUD_Scale_Disable();
 
        if(autocvar_r_letterbox == 0)
+       {
                if(autocvar_viewsize < 120)
                {
                        if(!MUTATOR_CALLHOOK(DrawScoreboardAccuracy))
@@ -911,6 +916,7 @@ void HUD_Draw(entity this)
                        HUD_Main();
                        HUD_Scale_Disable();
                }
+       }
 
        // crosshair goes VERY LAST
        UpdateDamage();