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>
deque
Lukasz Gromanowski 10 years ago
parent fa65c8981a
commit 3b9cfba03c

@ -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…
Cancel
Save