From 7a4866076767a953350ca4c384c2802f07c4c255 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 25 Jun 2017 19:20:42 +1000 Subject: [PATCH] Don't render items at all if their alpha is <= 0 --- qcsrc/common/t_items.qc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 2746eabfc..5e03def24 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -63,6 +63,8 @@ void Item_SetAlpha(entity this) this.colormod = this.glowmod = autocvar_cl_weapon_stay_color; this.alpha = autocvar_cl_weapon_stay_alpha; } + + this.drawmask = ((this.alpha <= 0) ? 0 : MASK_NORMAL); } void ItemDraw(entity this) @@ -127,9 +129,7 @@ void Item_PreDraw(entity this) { if(warpzone_warpzones_exist) { - // just incase warpzones were initialized last, reset these - //this.alpha = 1; // alpha is already set by the draw function - this.drawmask = MASK_NORMAL; + setpredraw(this, func_null); // no need to keep running this return; } float alph; @@ -145,8 +145,8 @@ void Item_PreDraw(entity this) this.alpha = alph; if(alph <= 0) this.drawmask = 0; - else - this.drawmask = MASK_NORMAL; + //else + //this.drawmask = MASK_NORMAL; // reset by the setalpha function } void ItemRemove(entity this) @@ -213,7 +213,7 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew) this.fade_end = ReadShort(); this.fade_start = ReadShort(); - if(this.fade_start && !autocvar_cl_items_nofade) + if(!warpzone_warpzones_exist && this.fade_start && !autocvar_cl_items_nofade) setpredraw(this, Item_PreDraw); if(this.mdl) -- 2.39.2