Keep a sound updated with its object's position

actorid
Chris Robinson 12 years ago
parent c94653dc49
commit f73008546f

@ -546,6 +546,13 @@ namespace MWSound
mActiveSounds.erase(snditer++); mActiveSounds.erase(snditer++);
else 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->first->update();
snditer++; snditer++;
} }

Loading…
Cancel
Save