From: Mario Date: Sun, 25 Jun 2017 09:20:42 +0000 (+1000) Subject: Don't render items at all if their alpha is <= 0 X-Git-Tag: xonotic-v0.8.5~2698 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7a4866076767a953350ca4c384c2802f07c4c255;p=xonotic%2Fxonotic-data.pk3dir.git Don't render items at all if their alpha is <= 0 --- 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)