1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-30 09:06:43 +00:00

Don't play a weapon-down sound when unreadying a spell

This commit is contained in:
Chris Robinson 2013-07-25 00:46:20 -07:00
parent 92cc566fdc
commit 4ad28ed369

View file

@ -399,12 +399,9 @@ bool CharacterController::updateNpcState()
mUpperBodyState = UpperCharState_EquipingWeap; mUpperBodyState = UpperCharState_EquipingWeap;
} }
mWeaponType = weaptype; if(weapon != inv.end() && !(weaptype == WeapType_None && mWeaponType == WeapType_Spell))
getWeaponGroup(mWeaponType, mCurrentWeapon);
if(weapon != inv.end())
{ {
std::string soundid = (mWeaponType == WeapType_None) ? std::string soundid = (weaptype == WeapType_None) ?
MWWorld::Class::get(*weapon).getDownSoundId(*weapon) : MWWorld::Class::get(*weapon).getDownSoundId(*weapon) :
MWWorld::Class::get(*weapon).getUpSoundId(*weapon); MWWorld::Class::get(*weapon).getUpSoundId(*weapon);
if(!soundid.empty()) if(!soundid.empty())
@ -413,6 +410,9 @@ bool CharacterController::updateNpcState()
sndMgr->playSound3D(mPtr, soundid, 1.0f, 1.0f); sndMgr->playSound3D(mPtr, soundid, 1.0f, 1.0f);
} }
} }
mWeaponType = weaptype;
getWeaponGroup(mWeaponType, mCurrentWeapon);
} }