Apply only crossbow reload animation to upper body

pull/469/head
Andrei Kortunov 7 years ago
parent fe19d8ff35
commit 71bcc11ba5

@ -1215,6 +1215,7 @@ bool CharacterController::updateWeaponState()
MWRender::Animation::AnimPriority priorityWeapon(Priority_Weapon); MWRender::Animation::AnimPriority priorityWeapon(Priority_Weapon);
priorityWeapon[MWRender::Animation::BoneGroup_LowerBody] = Priority_WeaponLowerBody; priorityWeapon[MWRender::Animation::BoneGroup_LowerBody] = Priority_WeaponLowerBody;
bool forcestateupdate = false; bool forcestateupdate = false;
// We should not play equipping animation and sound during weapon->weapon transition // We should not play equipping animation and sound during weapon->weapon transition
@ -1663,18 +1664,22 @@ bool CharacterController::updateWeaponState()
break; break;
} }
// Note: apply reload animations only for upper body since blending with movement animations can give weird result. // Note: apply crossbow reload animation only for upper body
// Especially noticable with crossbow reload animation. // since blending with movement animations can give weird result.
if(!start.empty()) if(!start.empty())
{ {
int mask = MWRender::Animation::BlendMask_All;
if (mWeaponType == WeapType_Crossbow)
mask = MWRender::Animation::BlendMask_UpperBody;
mAnimation->disable(mCurrentWeapon); mAnimation->disable(mCurrentWeapon);
if (mUpperBodyState == UpperCharState_FollowStartToFollowStop) if (mUpperBodyState == UpperCharState_FollowStartToFollowStop)
mAnimation->play(mCurrentWeapon, priorityWeapon, mAnimation->play(mCurrentWeapon, priorityWeapon,
MWRender::Animation::BlendMask_UpperBody, true, mask, true,
weapSpeed, start, stop, 0.0f, 0); weapSpeed, start, stop, 0.0f, 0);
else else
mAnimation->play(mCurrentWeapon, priorityWeapon, mAnimation->play(mCurrentWeapon, priorityWeapon,
MWRender::Animation::BlendMask_UpperBody, false, mask, false,
weapSpeed, start, stop, 0.0f, 0); weapSpeed, start, stop, 0.0f, 0);
} }
} }

Loading…
Cancel
Save