mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 18:36:41 +00:00
Move weapon equip sound logic to weapon equip animation logic
This commit is contained in:
parent
9f39f6d48e
commit
c4881c8613
1 changed files with 7 additions and 7 deletions
|
@ -1129,7 +1129,6 @@ bool CharacterController::updateWeaponState()
|
|||
|
||||
const bool isWerewolf = cls.isNpc() && cls.getNpcStats(mPtr).isWerewolf();
|
||||
|
||||
std::string upSoundId;
|
||||
std::string downSoundId;
|
||||
bool weaponChanged = false;
|
||||
bool ammunition = true;
|
||||
|
@ -1145,8 +1144,6 @@ bool CharacterController::updateWeaponState()
|
|||
if (weapon != inv.end())
|
||||
{
|
||||
newWeapon = *weapon;
|
||||
if (mWeaponType != ESM::Weapon::HandToHand && isRealWeapon(weaptype))
|
||||
upSoundId = newWeapon.getClass().getUpSoundId(newWeapon);
|
||||
if (isRealWeapon(mWeaponType))
|
||||
downSoundId = newWeapon.getClass().getDownSoundId(newWeapon);
|
||||
}
|
||||
|
@ -1304,10 +1301,13 @@ bool CharacterController::updateWeaponState()
|
|||
{
|
||||
mAnimation->showWeapons(true);
|
||||
}
|
||||
}
|
||||
if (!upSoundId.empty())
|
||||
{
|
||||
sndMgr->playSound3D(mPtr, upSoundId, 1.0f, 1.0f);
|
||||
|
||||
if (!mWeapon.isEmpty() && mWeaponType != ESM::Weapon::HandToHand && isRealWeapon(weaptype))
|
||||
{
|
||||
std::string upSoundId = mWeapon.getClass().getUpSoundId(mWeapon);
|
||||
if (!upSoundId.empty())
|
||||
sndMgr->playSound3D(mPtr, upSoundId, 1.0f, 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue