forked from mirror/openmw-tes3mp
Do not play draw weapon animation when equip a new weapon (bug #4056)
This commit is contained in:
parent
771f58ce58
commit
5da532a36c
1 changed files with 14 additions and 6 deletions
|
@ -1116,6 +1116,11 @@ bool CharacterController::updateWeaponState()
|
||||||
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
|
||||||
|
bool isStillWeapon = weaptype > WeapType_HandToHand && weaptype < WeapType_Spell &&
|
||||||
|
mWeaponType > WeapType_HandToHand && mWeaponType < WeapType_Spell;
|
||||||
|
|
||||||
if(weaptype != mWeaponType && mHitState != CharState_KnockDown && mHitState != CharState_KnockOut
|
if(weaptype != mWeaponType && mHitState != CharState_KnockDown && mHitState != CharState_KnockOut
|
||||||
&& mHitState != CharState_Hit)
|
&& mHitState != CharState_Hit)
|
||||||
{
|
{
|
||||||
|
@ -1138,13 +1143,16 @@ bool CharacterController::updateWeaponState()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
getWeaponGroup(weaptype, weapgroup);
|
getWeaponGroup(weaptype, weapgroup);
|
||||||
mAnimation->showWeapons(false);
|
|
||||||
mAnimation->setWeaponGroup(weapgroup);
|
mAnimation->setWeaponGroup(weapgroup);
|
||||||
|
|
||||||
|
if (!isStillWeapon)
|
||||||
|
{
|
||||||
|
mAnimation->showWeapons(false);
|
||||||
mAnimation->play(weapgroup, priorityWeapon,
|
mAnimation->play(weapgroup, priorityWeapon,
|
||||||
MWRender::Animation::BlendMask_All, true,
|
MWRender::Animation::BlendMask_All, true,
|
||||||
1.0f, "equip start", "equip stop", 0.0f, 0);
|
1.0f, "equip start", "equip stop", 0.0f, 0);
|
||||||
mUpperBodyState = UpperCharState_EquipingWeap;
|
mUpperBodyState = UpperCharState_EquipingWeap;
|
||||||
|
}
|
||||||
|
|
||||||
if(isWerewolf)
|
if(isWerewolf)
|
||||||
{
|
{
|
||||||
|
@ -1158,7 +1166,7 @@ bool CharacterController::updateWeaponState()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!soundid.empty())
|
if(!soundid.empty() && !isStillWeapon)
|
||||||
{
|
{
|
||||||
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
||||||
sndMgr->playSound3D(mPtr, soundid, 1.0f, 1.0f);
|
sndMgr->playSound3D(mPtr, soundid, 1.0f, 1.0f);
|
||||||
|
|
Loading…
Reference in a new issue