]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/csqcmodel_hooks.qc
Merge remote-tracking branch 'origin/samual/notification_rewrite'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / csqcmodel_hooks.qc
index 23facf87f7fcc787348a1d43a406ef8089a5afbb..a9f8410b4178a4006be7d0cc0659db8d4615425e 100644 (file)
@@ -218,7 +218,7 @@ void CSQCPlayer_ForceModel_Apply(float islocalplayer)
                entity tm;
 
                for(tm = teams.sort_next; tm; tm = tm.sort_next)
-                       if(tm.team != COLOR_SPECTATOR)
+                       if(tm.team != NUM_SPECTATOR)
                                ++teams_count;
 
                if(autocvar_cl_forcemyplayercolors)
@@ -398,11 +398,8 @@ void CSQCModel_AutoTagIndex_Apply(void)
                                        }
                                        else if(self.tag_entity.isplayermodel)
                                        {
-                                               self.tag_index = gettagindex(self.tag_entity, "weapon");
-                                               if(!self.tag_index)
-                                                       self.tag_index = gettagindex(self.tag_entity, "tag_weapon");
-                                               if(!self.tag_index)
-                                                       self.tag_index = gettagindex(self.tag_entity, "bip01 r hand");
+                                               skeleton_loadinfo(self.tag_entity);
+                                               self.tag_index = self.tag_entity.bone_weapon;
                                        }
                                }
 
@@ -611,7 +608,8 @@ void CSQCModel_Hook_PreDraw(float isplayer)
                else
                {
                        // we know that frame3 and frame4 fields, used by InterpolateAnimation, are left alone - but that is all we know!
-                       float doblend = autocvar__animblend;
+                       skeleton_loadinfo(self);
+                       float doblend = (self.bone_upperbody >= 0);
                        float onground = 0;
                        if(self == csqcplayer)
                        {
@@ -625,11 +623,11 @@ void CSQCModel_Hook_PreDraw(float isplayer)
                        }
                        else
                        {
-                               traceline(self.origin + '0 0 1' * self.maxs_z, self.origin + '0 0 1' * (self.mins_z - 4), MOVE_NOMONSTERS, self);
+                               tracebox(self.origin + '0 0 1', self.mins, self.maxs, self.origin - '0 0 4', MOVE_NORMAL, self);
                                if(trace_startsolid || trace_fraction < 1)
                                        onground = 1;
                        }
-                       animdecide_init(self); // FIXME only do this on model change
+                       animdecide_init(self);
                        animdecide_setimplicitstate(self, onground);
                        animdecide_setframes(self, doblend, anim_frame, anim_frame1time, anim_frame2, anim_frame2time);
                        float sf = 0;
@@ -654,7 +652,7 @@ void CSQCModel_Hook_PreDraw(float isplayer)
                        CSQCModel_InterpolateAnimation_2To4_Do();
                        if(doblend)
                        {
-                               skeleton_from_frames(self);
+                               skeleton_from_frames(self, self.csqcmodel_isdead);
                        }
                        else
                        {
@@ -673,6 +671,8 @@ void CSQCModel_Hook_PreDraw(float isplayer)
 
 void CSQCModel_Hook_PreUpdate(float isnew, float isplayer, float islocalplayer)
 {
+       // interpolate v_angle
+       self.iflags |= IFLAG_V_ANGLE_X;
        // revert to values from server
        CSQCModel_Effects_PreUpdate();
        if(self.isplayermodel)