1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-13 12:40:04 +00:00

Keep a sound updated with its object's position

This commit is contained in:
Chris Robinson 2013-07-27 07:24:18 -07:00
parent c94653dc49
commit f73008546f

View File

@ -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++;
}