From f73008546f828debd607600833913a441c569513 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 27 Jul 2013 07:24:18 -0700 Subject: [PATCH] Keep a sound updated with its object's position --- apps/openmw/mwsound/soundmanagerimp.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/openmw/mwsound/soundmanagerimp.cpp b/apps/openmw/mwsound/soundmanagerimp.cpp index 2b4978158..1e431d54a 100644 --- a/apps/openmw/mwsound/soundmanagerimp.cpp +++ b/apps/openmw/mwsound/soundmanagerimp.cpp @@ -546,6 +546,13 @@ namespace MWSound mActiveSounds.erase(snditer++); else { + const MWWorld::Ptr &ptr = snditer->second.first; + if(!ptr.isEmpty()) + { + const ESM::Position &pos = ptr.getRefData().getPosition(); + const Ogre::Vector3 objpos(pos.pos[0], pos.pos[1], pos.pos[2]); + snditer->first->setPosition(objpos); + } snditer->first->update(); snditer++; }