]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
minor fixes for csqcplayers
authorRudolf Polzer <divverent@alientrap.org>
Sun, 1 Jan 2012 12:14:52 +0000 (13:14 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 1 Jan 2012 12:14:52 +0000 (13:14 +0100)
qcsrc/server/cl_player.qc
qcsrc/server/g_subs.qc

index c6d09327c466845f67d2368c94566b57d9c3af33..6d7c8b9ac8b42a3c2a54c046c3cd81fe51cf32c5 100644 (file)
@@ -185,6 +185,7 @@ void CopyBody(float keepvelocity)
        if (keepvelocity == 1)
                self.velocity = oldself.velocity;
        self.oldvelocity = self.velocity;
+       self.alpha = oldself.alpha;
        self.fade_time = oldself.fade_time;
        self.fade_rate = oldself.fade_rate;
        //self.weapon = oldself.weapon;
index 6a62d61b5d423e43debf69ab9461e031c427142c..e119e5aba40040a359eca73d26d6a909f6f5d128 100644 (file)
@@ -110,7 +110,7 @@ void SUB_VanishOrRemove (entity ent)
        if (ent.flags & FL_CLIENT)
        {
                // vanish
-               ent.model = "";
+               ent.alpha = -1;
                ent.effects = 0;
                ent.glow_size = 0;
                ent.pflags = 0;
@@ -124,12 +124,15 @@ void SUB_VanishOrRemove (entity ent)
 
 void SUB_SetFade_Think (void)
 {
+       if(self.alpha == 0)
+               self.alpha = 1;
        self.think = SUB_SetFade_Think;
-       self.nextthink = self.fade_time;
-       self.alpha = 1 - (time - self.fade_time) * self.fade_rate;
+       self.nextthink = time;
+       self.alpha -= frametime * self.fade_rate;
        if (self.alpha < 0.01)
                SUB_VanishOrRemove(self);
-       self.alpha = bound(0.01, self.alpha, 1);
+       else
+               self.nextthink = time;
 }
 
 /*
@@ -145,7 +148,6 @@ void SUB_SetFade (entity ent, float when, float fadetime)
        //      return;
        //ent.alpha = 1;
        ent.fade_rate = 1/fadetime;
-       ent.fade_time = when;
        ent.think = SUB_SetFade_Think;
        ent.nextthink = when;
 }