]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
disable up/down aiming while dead, fixes #1420
authorRudolf Polzer <divverent@xonotic.org>
Sun, 24 Feb 2013 19:05:46 +0000 (20:05 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 24 Feb 2013 19:05:56 +0000 (20:05 +0100)
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/player_skeleton.qc
qcsrc/client/player_skeleton.qh

index 9caf9419f11f82170c54b47c6c90c9fe4d345da8..1f8306e7675f4609b13f75777821ff12ad27902f 100644 (file)
@@ -652,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
                        {
index 3ea3b280d2bd09c499b6b42ac5c0ec35d031a63d..7784fc1f693fe2bb54674220bb47c4ace5f57162 100644 (file)
@@ -98,7 +98,7 @@ void free_skeleton_from_frames(entity e)
        }
 }
 
-void skeleton_from_frames(entity e)
+void skeleton_from_frames(entity e, float is_dead)
 {
        float i;
        float m = e.modelindex;
@@ -166,16 +166,19 @@ void skeleton_from_frames(entity e)
                skel_set_boneabs(s, e.bone_upperbody, org);
        }
 
-       for(i = 0; i < MAX_AIM_BONES; ++i)
+       if(!is_dead)
        {
-               if(e.(bone_aim[i]))
+               for(i = 0; i < MAX_AIM_BONES; ++i)
                {
-                       vector aim = '1 0 0' * bound(-90, self.v_angle_x, 90) * e.(bone_aimweight[i]);
-                       vector org = skel_get_boneabs(s, e.(bone_aim[i]));
-                       vector ang_cur = fixedvectoangles2(v_forward, v_up);
-                       vector ang = AnglesTransform_Multiply(aim, ang_cur);
-                       fixedmakevectors(ang);
-                       skel_set_boneabs(s, e.(bone_aim[i]), org);
+                       if(e.(bone_aim[i]))
+                       {
+                               vector aim = '1 0 0' * bound(-90, self.v_angle_x, 90) * e.(bone_aimweight[i]);
+                               vector org = skel_get_boneabs(s, e.(bone_aim[i]));
+                               vector ang_cur = fixedvectoangles2(v_forward, v_up);
+                               vector ang = AnglesTransform_Multiply(aim, ang_cur);
+                               fixedmakevectors(ang);
+                               skel_set_boneabs(s, e.(bone_aim[i]), org);
+                       }
                }
        }
 }
index 047a15671f1e29e51417ee4cb3be37de5d1fa86f..d369bac4ec192db99f04978d17c38c28128015b4 100644 (file)
@@ -1,5 +1,5 @@
 void free_skeleton_from_frames(entity e);
-void skeleton_from_frames(entity e);
+void skeleton_from_frames(entity e, float is_dead);
 void skeleton_loadinfo(entity e);
 
 .float bone_upperbody;