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;
if (ent.flags & FL_CLIENT)
{
// vanish
- ent.model = "";
+ ent.alpha = -1;
ent.effects = 0;
ent.glow_size = 0;
ent.pflags = 0;
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;
}
/*
// return;
//ent.alpha = 1;
ent.fade_rate = 1/fadetime;
- ent.fade_time = when;
ent.think = SUB_SetFade_Think;
ent.nextthink = when;
}