From: Rudolf Polzer Date: Sun, 24 Feb 2013 19:05:46 +0000 (+0100) Subject: disable up/down aiming while dead, fixes #1420 X-Git-Tag: xonotic-v0.7.0~81 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=21bea14cfb9c8c7dde99172d9c42883866f5bba6;p=xonotic%2Fxonotic-data.pk3dir.git disable up/down aiming while dead, fixes #1420 --- diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index 9caf9419f..1f8306e76 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -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 { diff --git a/qcsrc/client/player_skeleton.qc b/qcsrc/client/player_skeleton.qc index 3ea3b280d..7784fc1f6 100644 --- a/qcsrc/client/player_skeleton.qc +++ b/qcsrc/client/player_skeleton.qc @@ -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); + } } } } diff --git a/qcsrc/client/player_skeleton.qh b/qcsrc/client/player_skeleton.qh index 047a15671..d369bac4e 100644 --- a/qcsrc/client/player_skeleton.qh +++ b/qcsrc/client/player_skeleton.qh @@ -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;