]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix a bunch of clone bugs to get desired behaviour back
authorMrBougo <mrbougo@xonotic.org>
Mon, 4 Aug 2014 08:44:13 +0000 (10:44 +0200)
committerMrBougo <mrbougo@xonotic.org>
Sun, 23 Nov 2014 16:11:20 +0000 (17:11 +0100)
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)

qcsrc/server/cl_player.qc

index c11e92051074b7fcbf15b208b774f14d96c00d88..176e42122a0c5e51de7449de372cace0d2427e53 100644 (file)
@@ -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);