From f2748912d331478793dc194b215a650fea105108 Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 13 Jul 2023 00:18:02 +0200 Subject: [PATCH] Darkness nade: avoid drawing another useless color flash --- qcsrc/client/view.qc | 5 ++++- qcsrc/common/mutators/mutator/nades/nades.qc | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index c9de0d1562..7e94408991 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -860,7 +860,10 @@ void HUD_Draw(entity this) { 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); + vector col = M_ARGV(0, vector); + float alpha_multipl = M_ARGV(1, float); + if (alpha_multipl > 0) + drawfill('0 0 0', vec2(vid_conwidth, vid_conheight), col, autocvar_hud_colorflash_alpha * alpha_multipl, DRAWFLAG_ADDITIVE); } else if(STAT(FROZEN)) { diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 6e3f8a23ce..3ee6020cfb 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -59,12 +59,11 @@ MUTATOR_HOOKFUNCTION(cl_nades, HUD_Draw_overlay) if (!darkblink) sound(csqcplayer, CH_PAIN, SND_BLIND, VOL_BASE, ATTEN_NORM); darkblink = true; - M_ARGV(0, vector) = NADE_TYPE_DARKNESS.m_color; HUD_DarkBlinking(); + M_ARGV(1, float) = 0; // alpha_multipl 0, don't draw normal overlay return true; } - else - darkblink = false; + darkblink = false; return false; } -- 2.39.2