]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_player.qc
bring death glow back, fix issues with respawning
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_player.qc
index 483446dccfb6c25fb781d38933b9001c5143de56..75f1c076b9312953d1a0fa84b6d01634257cd625 100644 (file)
@@ -166,6 +166,7 @@ void CopyBody(float keepvelocity)
        self.animstate_endtime = oldself.animstate_endtime;
        self.animstate_override = oldself.animstate_override;
        self.animstate_looping = oldself.animstate_looping;
+       self.death_time = oldself.death_time;
        self.frame = oldself.frame;
        self.pain_finished = oldself.pain_finished;
        self.health = oldself.health;
@@ -185,6 +186,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;
@@ -196,7 +198,7 @@ void CopyBody(float keepvelocity)
        Drag_MoveDrag(oldself, self);
 
        if(self.colormap <= maxclients && self.colormap > 0)
-               self.colormap = 1024 + self.clientcolors;
+               self.colormap = 1024 + oldself.clientcolors;
 
        CSQCMODEL_AUTOINIT();
        self.CopyBody_nextthink = oldself.nextthink;
@@ -408,7 +410,7 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float
        self.dmg_take = self.dmg_take + take;//max(take - 10, 0);
        self.dmg_inflictor = inflictor;
 
-       if (self.health <= -autocvar_sv_gibhealth && !(self.effects & CSQCMODEL_EF_INVISIBLE))
+       if (self.health <= -autocvar_sv_gibhealth && self.alpha >= 0)
        {
                // don't use any animations as a gib
                self.frame = 0;
@@ -416,7 +418,7 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float
                self.view_ofs = '0 0 4';
 
                Violence_GibSplash(self, 1, 1, attacker);
-               self.effects |= CSQCMODEL_EF_INVISIBLE;
+               self.alpha = -1;
                self.solid = SOLID_NOT; // restore later
        }
 }
@@ -656,7 +658,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                if(!g_freezetag)
                {
                        // become fully visible
-                       self.alpha = 1;
+                       self.alpha = default_player_alpha;
                        // throw a weapon
                        SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon);
                }
@@ -757,13 +759,14 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                if(!waves)
                        waves = autocvar_g_respawn_waves;
                if(waves)
-                       self.death_time = ceil((time + sdelay) / waves) * waves;
+                       self.respawn_time = ceil((time + sdelay) / waves) * waves;
                else
-                       self.death_time = time + sdelay;
-               if((sdelay + waves >= 5.0) && (self.death_time - time > 1.75))
+                       self.respawn_time = time + sdelay;
+               if((sdelay + waves >= 5.0) && (self.respawn_time - time > 1.75))
                        self.respawn_countdown = 10; // first number to count down from is 10
                else
                        self.respawn_countdown = -1; // do not count down
+               self.death_time = time;
                if (random() < 0.5)
                        setanim(self, self.anim_die1, FALSE, TRUE, TRUE);
                else