1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 21:45:32 +00:00

Fix playing pending voices without a Ptr

This commit is contained in:
Chris Robinson 2015-12-02 16:07:19 -08:00
parent 2face3d0a9
commit f19f1c47c8

View file

@ -890,13 +890,17 @@ namespace MWSound
DecoderPtr decoder = penditer->second.first;
decoder->rewind();
MWBase::SoundStreamPtr sound;
MWWorld::Ptr ptr = penditer->first;
const ESM::Position &pos = ptr.getRefData().getPosition();
const osg::Vec3f objpos(pos.asVec3());
if(ptr == MWWorld::Ptr())
sound = playVoice(decoder, osg::Vec3f(), true);
else
{
const ESM::Position &pos = ptr.getRefData().getPosition();
const osg::Vec3f objpos(pos.asVec3());
MWBase::SoundStreamPtr sound = playVoice(decoder,
objpos, (ptr == MWMechanics::getPlayer())
);
sound = playVoice(decoder, objpos, (ptr == MWMechanics::getPlayer()));
}
mActiveSaySounds[ptr] = std::make_pair(sound, loudness);
}
catch(std::exception &e) {