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