Fix csqcmodel display for cloned/dead players. Also clone aiming direction :)
authorRudolf Polzer <divverent@xonotic.org>
Fri, 20 Dec 2013 10:44:45 +0000 (11:44 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 20 Dec 2013 10:44:45 +0000 (11:44 +0100)
qcsrc/client/csqcmodel_hooks.qc
qcsrc/common/csqcmodel_settings.qh
qcsrc/server/cl_player.qc

index 848c632..fb87f9a 100644 (file)
@@ -610,7 +610,22 @@ void CSQCModel_Hook_PreDraw(float isplayer)
                CSQCPlayer_ModelAppearance_Apply(self.entnum == player_localnum + 1);
                CSQCPlayer_LOD_Apply();
                if(!isplayer)
+               {
+                       skeleton_loadinfo(self);
+                       float doblend = (self.bone_upperbody >= 0);
                        CSQCPlayer_FallbackFrame_Apply();
+                       if(doblend)
+                       {
+                               skeleton_from_frames(self, self.csqcmodel_isdead);
+                       }
+                       else
+                       {
+                               free_skeleton_from_frames(self);
+                               // just in case, clear these (we're animating in frame and frame3)
+                               self.lerpfrac = 0;
+                               self.lerpfrac4 = 0;
+                       }
+               }
                else
                {
                        // we know that frame3 and frame4 fields, used by InterpolateAnimation, are left alone - but that is all we know!
index 9f202d2..cfe0122 100644 (file)
@@ -47,8 +47,8 @@
                CSQCMODEL_ENDIF \
                CSQCMODEL_PROPERTY(512, float, ReadChar, WriteChar, anim_upper_action) \
                CSQCMODEL_PROPERTY(512, float, ReadApproxPastTime, WriteApproxPastTime, anim_upper_time) \
-               CSQCMODEL_PROPERTY(1024, float, ReadAngle, WriteAngle, v_angle_x) \
        CSQCMODEL_ENDIF \
+       CSQCMODEL_PROPERTY(1024, float, ReadAngle, WriteAngle, v_angle_x) \
        CSQCMODEL_PROPERTY_SCALED(4096, float, ReadByte, WriteByte, scale, 16, 0, 255)
 // TODO get rid of colormod/glowmod here, find good solution for nex charge glowmod hack; also get rid of some useless properties on non-players that only exist for CopyBody
 
index eb3e81f..0229d3e 100644 (file)
@@ -155,6 +155,7 @@ void CopyBody(float keepvelocity)
        self.teleportable = oldself.teleportable;
        self.damagedbycontents = oldself.damagedbycontents;
        self.angles = oldself.angles;
+       self.v_angle = oldself.v_angle;
        self.avelocity = oldself.avelocity;
        self.classname = "body";
        self.damageforcescale = oldself.damageforcescale;