From e71aa53574f29860f7bf1e4baa254a44cde78add Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 24 Mar 2016 18:31:37 +0100 Subject: [PATCH] Don't allow playing a sound/soundgen key more than once at the same time on the same object (Fixes #2689) --- apps/openmw/mwmechanics/character.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 30a4ec9f7..82c289200 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -756,6 +756,7 @@ void CharacterController::handleTextKey(const std::string &groupname, const std: if(evt.compare(0, 7, "sound: ") == 0) { MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager(); + sndMgr->stopSound3D(mPtr, evt.substr(7)); sndMgr->playSound3D(mPtr, evt.substr(7), 1.0f, 1.0f); return; } @@ -796,7 +797,10 @@ void CharacterController::handleTextKey(const std::string &groupname, const std: MWBase::SoundManager::Play_NoPlayerLocal); } else + { + sndMgr->stopSound3D(mPtr, sound); sndMgr->playSound3D(mPtr, sound, volume, pitch); + } } return; }