From: Penguinum Date: Wed, 6 May 2015 18:35:30 +0000 (+0300) Subject: alpha_min X-Git-Tag: xonotic-v0.8.1~40^2~8 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=4321d0ff877aa81f1bf763156c64e9e3481b855e;p=xonotic%2Fxonotic-data.pk3dir.git alpha_min --- diff --git a/qcsrc/client/wall.qc b/qcsrc/client/wall.qc index d80787d73..14de3c228 100644 --- a/qcsrc/client/wall.qc +++ b/qcsrc/client/wall.qc @@ -13,9 +13,11 @@ void Ent_Wall_PreDraw() if(!checkpvs(org, self)) self.alpha = 0; else if(self.fade_start) { - self.alpha = self.alpha_max / 100.0 * bound(0, - (self.fade_end - vlen(org - self.origin - 0.5 * (self.mins + self.maxs))) - / (self.fade_end - self.fade_start), 1); + vector player_dist = org - self.origin - 0.5 * (self.mins + self.maxs); + player_dist_z = 0; + self.alpha = (self.alpha_min + self.alpha_max * bound(0, + (self.fade_end - vlen(player_dist)) + / (self.fade_end - self.fade_start), 1)) / 100.0; } else {