mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 02:15:32 +00:00
Issue #1887: Equipped items do not emit sounds
Sounds are played only when actors draw state is equal to MWMechanics::DrawState_Nothing Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
This commit is contained in:
parent
fa65c8981a
commit
3b9cfba03c
1 changed files with 2 additions and 1 deletions
|
@ -664,12 +664,13 @@ bool NpcAnimation::addOrReplaceIndividualPart(ESM::PartReferenceType type, int g
|
|||
|
||||
std::string soundId;
|
||||
MWWorld::ContainerStoreIterator csi = mInv.getSlot(group < 0 ? MWWorld::InventoryStore::Slot_Helmet : group);
|
||||
|
||||
if (csi != mInv.end() && csi->getTypeName() == typeid(ESM::Light).name())
|
||||
{
|
||||
soundId = csi->get<ESM::Light>()->mBase->mSound;
|
||||
}
|
||||
mObjectParts[type] = std::make_pair(insertBoundedPart(mesh, group, sPartList.at(type), enchantedGlow, glowColor), soundId);
|
||||
if (!soundId.empty())
|
||||
if (!soundId.empty() && mPtr.getClass().getCreatureStats(mPtr).getDrawState() == MWMechanics::DrawState_Nothing)
|
||||
{
|
||||
MWBase::Environment::get().getSoundManager()->playSound3D(mPtr, soundId, 1.0f, 1.0f, MWBase::SoundManager::Play_TypeSfx,
|
||||
MWBase::SoundManager::Play_Loop);
|
||||
|
|
Loading…
Reference in a new issue