From f9d41fcfe856051bd6cdd4e691d4bff3988baab3 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Mon, 1 Aug 2022 04:03:00 +0300 Subject: [PATCH] Don't stop playing sounds attached to removed objects (bug #6896) --- CHANGELOG.md | 1 + apps/openmw/mwworld/scene.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 168d03310a..29522bab11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -141,6 +141,7 @@ Bug #6849: ImageButton texture is not scaled properly Bug #6869: Hits queue stagger during swing animation Bug #6895: Removing a negative number of items from a script, makes the script terminate with an error + Bug #6896: Sounds played using PlaySound3D are cut off as the emitter leaves the cell Bug #6898: Accessing the Quick Inventory menu does not work while in menu mode Bug #6901: Morrowind.exe soul gem usage discrepancy Bug #6909: Using enchanted items has no animation diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index 035368d9de..63c21d1a1b 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -926,7 +926,11 @@ namespace MWWorld void Scene::removeObjectFromScene (const Ptr& ptr, bool keepActive) { MWBase::Environment::get().getMechanicsManager()->remove (ptr, keepActive); - MWBase::Environment::get().getSoundManager()->stopSound3D (ptr); + // You'd expect the sounds attached to the object to be stopped here + // because the object is nowhere to be heard, but in Morrowind, they're not. + // They're still stopped when the cell is unloaded + // or if the player moves away far from the object's position. + // Todd Howard, Who art in Bethesda, hallowed be Thy name. MWBase::Environment::get().getLuaManager()->objectRemovedFromScene(ptr); if (const auto object = mPhysics->getObject(ptr)) {