]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
alpha_min
authorPenguinum <penguinum@gmail.com>
Wed, 6 May 2015 18:35:30 +0000 (21:35 +0300)
committerPenguinum <penguinum@gmail.com>
Wed, 6 May 2015 18:35:30 +0000 (21:35 +0300)
qcsrc/client/wall.qc

index d80787d735c723d760063e7e573cbebe5fd961a5..14de3c228088b4b24bc960e84907848607282db6 100644 (file)
@@ -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
                {