mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-13 21:40:11 +00:00
Keep a sound updated with its object's position
This commit is contained in:
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…
x
Reference in New Issue
Block a user