From: Rudolf Polzer Date: Sun, 1 Jan 2012 12:14:52 +0000 (+0100) Subject: minor fixes for csqcplayers X-Git-Tag: xonotic-v0.6.0~189^2~14 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=034c9ba4b911900abe36670c407e2c20ecad8686;p=xonotic%2Fxonotic-data.pk3dir.git minor fixes for csqcplayers --- diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index c6d09327c..6d7c8b9ac 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -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; diff --git a/qcsrc/server/g_subs.qc b/qcsrc/server/g_subs.qc index 6a62d61b5..e119e5aba 100644 --- a/qcsrc/server/g_subs.qc +++ b/qcsrc/server/g_subs.qc @@ -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; }