From 326eaea8a6d86fb1ec565eee16242667b646c63d Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 31 Jan 2015 15:28:57 +0100 Subject: [PATCH] Add missing sound for drawing throwing weapons (Fixes #2308) --- apps/openmw/mwrender/weaponanimation.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/openmw/mwrender/weaponanimation.cpp b/apps/openmw/mwrender/weaponanimation.cpp index 8af4d637a..d75c0ce5a 100644 --- a/apps/openmw/mwrender/weaponanimation.cpp +++ b/apps/openmw/mwrender/weaponanimation.cpp @@ -7,6 +7,7 @@ #include "../mwbase/world.hpp" #include "../mwbase/environment.hpp" +#include "../mwbase/soundmanager.hpp" #include "../mwworld/inventorystore.hpp" #include "../mwworld/class.hpp" @@ -45,7 +46,15 @@ void WeaponAnimation::attachArrow(MWWorld::Ptr actor) MWWorld::InventoryStore& inv = actor.getClass().getInventoryStore(actor); MWWorld::ContainerStoreIterator weaponSlot = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight); if (weaponSlot != inv.end() && weaponSlot->get()->mBase->mData.mType == ESM::Weapon::MarksmanThrown) + { + std::string soundid = weaponSlot->getClass().getUpSoundId(*weaponSlot); + if(!soundid.empty()) + { + MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager(); + sndMgr->playSound3D(actor, soundid, 1.0f, 1.0f); + } showWeapon(true); + } else { NifOgre::ObjectScenePtr weapon = getWeapon();