From 601d6ee90ed9743bd3405f063ebba5c9ef38b9f7 Mon Sep 17 00:00:00 2001 From: drjaska Date: Mon, 9 Dec 2024 17:55:37 +0200 Subject: [PATCH] ternary golf --- qcsrc/client/view.qc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index c6ac393cf..84bf0d4f1 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -294,15 +294,9 @@ void viewmodel_animate(entity this) void viewmodel_draw(entity this) { // alpha calculations - float a = this.m_alpha; - float a_max = min(autocvar_cl_viewmodel_alpha, 1); - float a_min = -1; - if (autocvar_cl_viewmodel_alpha_min) - a_min = max(autocvar_cl_viewmodel_alpha_min, -1); - if (a_min >= a_max) - a = a_max; - else - a = bound(a_min, a, a_max); + float amax = (autocvar_cl_viewmodel_alpha != 0) ? autocvar_cl_viewmodel_alpha : 1; + float amin = (autocvar_cl_viewmodel_alpha_min != 0) ? autocvar_cl_viewmodel_alpha_min : -1; + float a = (amin >= amax) ? amax : bound(amin, this.m_alpha, amax); int mask = (intermission || (STAT(HEALTH) <= 0) || autocvar_chase_active) ? 0 : MASK_NORMAL; int wepskin = this.m_skin; -- 2.39.2