From 4649d7fa4174958f5907d61520d490b0c3428f21 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sat, 14 Aug 2010 09:29:38 +0200 Subject: [PATCH] stop sounds on cell change --- apps/openmw/mwsound/soundmanager.cpp | 2 +- apps/openmw/mwworld/world.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwsound/soundmanager.cpp b/apps/openmw/mwsound/soundmanager.cpp index b6f88daa1..20b365b37 100644 --- a/apps/openmw/mwsound/soundmanager.cpp +++ b/apps/openmw/mwsound/soundmanager.cpp @@ -120,7 +120,7 @@ namespace MWSound { } - void stopSound (MWWorld::Ptr::CellStore *cell) + void SoundManager::stopSound (MWWorld::Ptr::CellStore *cell) { // Note to Nico: You can get the cell of a Ptr via the getCell function. Just iterate over all // sounds and remove those with matching cell. diff --git a/apps/openmw/mwworld/world.cpp b/apps/openmw/mwworld/world.cpp index 823cb2528..620751f61 100644 --- a/apps/openmw/mwworld/world.cpp +++ b/apps/openmw/mwworld/world.cpp @@ -11,6 +11,8 @@ #include "../mwmechanics/mechanicsmanager.hpp" +#include "../mwsound/soundmanager.hpp" + #include "ptr.hpp" #include "environment.hpp" @@ -535,9 +537,9 @@ namespace MWWorld { mEnvironment.mMechanicsManager->dropActors (active->first); active->second->destroy(); + mEnvironment.mSoundManager->stopSound (active->first); delete active->second; mActiveCells.erase (active); - // TODO remove sounds } // register local scripts