From: terencehill Date: Wed, 12 Jul 2023 22:18:02 +0000 (+0200) Subject: Darkness nade: avoid drawing another useless color flash X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f2748912d331478793dc194b215a650fea105108;p=xonotic%2Fxonotic-data.pk3dir.git Darkness nade: avoid drawing another useless color flash --- 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; }