From: Rudolf Polzer Date: Wed, 15 Feb 2012 11:30:29 +0000 (+0100) Subject: Revert "do not rewrite colormap on corpses (but do rewrite in CopyBody cheats)" as... X-Git-Tag: xonotic-v0.6.0~70^2~4^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=769b5c4039e008c6509de575d5afc9b6468cdfd7;p=xonotic%2Fxonotic-data.pk3dir.git Revert "do not rewrite colormap on corpses (but do rewrite in CopyBody cheats)" as we don't need this anyway... we have another fix for the issue I wanted to fix with this. This reverts commit d391785297fb3bc674195dbf7c7adacb2de97d8c. --- diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index b3487657d..5ba860940 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -1,4 +1,4 @@ -entity CopyBody(float keepvelocity); +void CopyBody(float keepvelocity); #ifdef NOCHEATS @@ -158,18 +158,15 @@ float CheatImpulse(float i) case CHIMPULSE_CLONE_MOVING: IS_CHEAT(i, 0, 0); makevectors (self.v_angle); - e = CopyBody(1); - if(e.colormap <= maxclients && e.colormap > 0) - e.colormap = 1024 + self.clientcolors; - e.velocity = e.velocity + v_forward * 300; + self.velocity = self.velocity + v_forward * 300; + CopyBody(1); self.lip += 1; + self.velocity = self.velocity - v_forward * 300; DID_CHEAT(); break; case CHIMPULSE_CLONE_STANDING: IS_CHEAT(i, 0, 0); - e = CopyBody(0); - if(e.colormap <= maxclients && e.colormap > 0) - e.colormap = 1024 + self.clientcolors; + CopyBody(0); self.lip += 1; DID_CHEAT(); break; diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 86763c78a..49b52555f 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -140,14 +140,13 @@ void CopyBody_Think(void) CSQCMODEL_AUTOUPDATE(); self.nextthink = time; } -entity CopyBody(float keepvelocity) +void CopyBody(float keepvelocity) { - entity ret; entity oldself; if (self.effects & EF_NODRAW) - return world; + return; oldself = self; - ret = self = spawn(); + self = spawn(); self.enemy = oldself; self.lip = oldself.lip; self.colormap = oldself.colormap; @@ -201,6 +200,9 @@ entity CopyBody(float keepvelocity) self.owner = oldself; + if(self.colormap <= maxclients && self.colormap > 0) + self.colormap = 1024 + oldself.clientcolors; + CSQCMODEL_AUTOINIT(); self.CopyBody_nextthink = oldself.nextthink; self.CopyBody_think = oldself.think; @@ -208,8 +210,6 @@ entity CopyBody(float keepvelocity) self.think = CopyBody_Think; self = oldself; - - return ret; } float player_getspecies()