]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_player.qc
Merge branch 'master' into mirceakitsune/damage_effects
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_player.qc
index deb08aa9c618769bdb3bdcc67285e0d7447160fc..9dfc2a5b2825384ec16c351e645534b9480a9069 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;
@@ -195,8 +196,10 @@ void CopyBody(float keepvelocity)
 
        Drag_MoveDrag(oldself, self);
 
+       self.owner = oldself;
+
        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 +411,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,8 +419,9 @@ 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
+               self.takedamage = DAMAGE_NO; // restore later
        }
 }
 
@@ -656,7 +660,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);
                }