mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-04 15:45:34 +00:00
Fix playing pending voices without a Ptr
This commit is contained in:
parent
2face3d0a9
commit
f19f1c47c8
1 changed files with 9 additions and 5 deletions
|
@ -890,13 +890,17 @@ namespace MWSound
|
||||||
DecoderPtr decoder = penditer->second.first;
|
DecoderPtr decoder = penditer->second.first;
|
||||||
decoder->rewind();
|
decoder->rewind();
|
||||||
|
|
||||||
|
MWBase::SoundStreamPtr sound;
|
||||||
MWWorld::Ptr ptr = penditer->first;
|
MWWorld::Ptr ptr = penditer->first;
|
||||||
|
if(ptr == MWWorld::Ptr())
|
||||||
|
sound = playVoice(decoder, osg::Vec3f(), true);
|
||||||
|
else
|
||||||
|
{
|
||||||
const ESM::Position &pos = ptr.getRefData().getPosition();
|
const ESM::Position &pos = ptr.getRefData().getPosition();
|
||||||
const osg::Vec3f objpos(pos.asVec3());
|
const osg::Vec3f objpos(pos.asVec3());
|
||||||
|
|
||||||
MWBase::SoundStreamPtr sound = playVoice(decoder,
|
sound = playVoice(decoder, objpos, (ptr == MWMechanics::getPlayer()));
|
||||||
objpos, (ptr == MWMechanics::getPlayer())
|
}
|
||||||
);
|
|
||||||
mActiveSaySounds[ptr] = std::make_pair(sound, loudness);
|
mActiveSaySounds[ptr] = std::make_pair(sound, loudness);
|
||||||
}
|
}
|
||||||
catch(std::exception &e) {
|
catch(std::exception &e) {
|
||||||
|
|
Loading…
Reference in a new issue