From: MrBougo Date: Mon, 4 Aug 2014 08:44:13 +0000 (+0200) Subject: fix a bunch of clone bugs to get desired behaviour back X-Git-Tag: xonotic-v0.8.0~12^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ca5f321c9c0a42c051465a965c92b2c0e8e62cf5;p=xonotic%2Fxonotic-data.pk3dir.git fix a bunch of clone bugs to get desired behaviour back this also affects the animation of non-clone corpses in that animdecide_init is called (which should be a good thing as far as I can tell) --- diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index c11e92051..176e42122 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -214,6 +214,7 @@ void CopyBody(float keepvelocity) self.nextthink = time; self.think = CopyBody_Think; // "bake" the current animation frame for clones (they don't get clientside animation) + animdecide_init(self); animdecide_setframes(self, FALSE, frame, frame1time, frame2, frame2time); self = oldself; @@ -651,7 +652,8 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht } // print an obituary message - Obituary (attacker, inflictor, self, deathtype); + if(self.classname != "body") + Obituary (attacker, inflictor, self, deathtype); // increment frag counter for used weapon type float w; @@ -679,7 +681,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht // player could have been miraculously resuscitated ;) // e.g. players in freezetag get frozen, they don't really die - if(self.health >= 1 || !IS_PLAYER(self)) + if(self.health >= 1 || !(IS_PLAYER(self) || self.classname == "body")) return; // when we get here, player actually dies @@ -730,6 +732,14 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht // set up to fade out later SUB_SetFade (self, time + 6 + random (), 1); + // reset body think wrapper broken by SUB_SetFade + if(self.classname == "body" && self.think != CopyBody_Think) { + self.CopyBody_think = self.think; + self.CopyBody_nextthink = self.nextthink; + self.think = CopyBody_Think; + self.nextthink = time; + } + if(autocvar_sv_gentle > 0 || autocvar_ekg) { // remove corpse PlayerCorpseDamage (inflictor, attacker, autocvar_sv_gibhealth+1.0, deathtype, hitloc, force);