]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix colormap with copybody (so now, ghost bodies of dead players retain the player...
authorSamual <samual@xonotic.org>
Mon, 9 Jan 2012 04:33:57 +0000 (23:33 -0500)
committerSamual <samual@xonotic.org>
Mon, 9 Jan 2012 04:33:57 +0000 (23:33 -0500)
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc

index e6f0433c4e9eefc196bd7230db425506630af3fe..1db0e928a471e82e916ec4daf88b1115fbc797bd 100644 (file)
@@ -1750,7 +1750,6 @@ void UpdateChatBubble()
        else self.colormod = '1 1 1';
 }*/
 
-.float oldcolormap;
 void respawn(void)
 {
        if(self.alpha >= 0 && autocvar_g_respawn_ghosts)
@@ -1761,7 +1760,7 @@ void respawn(void)
                self.velocity = '0 0 1' * autocvar_g_respawn_ghosts_speed;
                self.avelocity = randomvec() * autocvar_g_respawn_ghosts_speed * 3 - randomvec() * autocvar_g_respawn_ghosts_speed * 3;
                self.effects |= EF_ADDITIVE;
-               self.oldcolormap = self.colormap;
+               self.oldcolormap = self.colormap; // saved for copybody to use later
                self.colormap = 0; // this originally was 512, but raises a warning in the engine, so get rid of it
                pointparticles(particleeffectnum("respawn_ghost"), self.origin, '0 0 0', 1);
                if(autocvar_g_respawn_ghosts_maxtime)
@@ -1770,11 +1769,13 @@ void respawn(void)
 
        CopyBody(1);
        self.effects |= EF_NODRAW; // prevent another CopyBody
-       if(self.oldcolormap)
+       
+       if(self.oldcolormap) // reset it so that when they respawn it'll be back to normal
        {
                self.colormap = self.oldcolormap;
                self.oldcolormap = 0;
        }
+       
        PutClientInServer();
 }
 
index 04ad12c6ef66b0a8685b8e55ef277b0fe19e9c6a..ae09df2975baf0eaac2f9442a7f0265b4c0ae2bf 100644 (file)
@@ -124,6 +124,8 @@ void WeaponStats_LogKill(float awep, float abot, float vwep, float vbot)
 .entity pusher;
 .float pushltime;
 
+.float oldcolormap; // also used in cl_client.c:void respawn(void)
+
 .float CopyBody_nextthink;
 .void(void) CopyBody_think;
 void CopyBody_Think(void)
@@ -149,7 +151,7 @@ void CopyBody(float keepvelocity)
        self = spawn();
        self.enemy = oldself;
        self.lip = oldself.lip;
-       self.colormap = oldself.colormap;
+       self.colormap = oldself.oldcolormap;
        self.iscreature = oldself.iscreature;
        self.damagedbycontents = oldself.damagedbycontents;
        self.angles = oldself.angles;