mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-22 18:53:52 +00:00
Fix crash in ProjectileManager when a sound id fails to play or is not found
This commit is contained in:
parent
911807ad4f
commit
7b5f3e3cdc
1 changed files with 7 additions and 3 deletions
|
@ -280,7 +280,9 @@ namespace MWWorld
|
||||||
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
||||||
for (size_t it = 0; it != state.mSoundIds.size(); it++)
|
for (size_t it = 0; it != state.mSoundIds.size(); it++)
|
||||||
{
|
{
|
||||||
state.mSounds.push_back(sndMgr->playSound3D(pos, state.mSoundIds.at(it), 1.0f, 1.0f, MWBase::SoundManager::Play_TypeSfx, MWBase::SoundManager::Play_Loop));
|
MWBase::SoundPtr sound = sndMgr->playSound3D(pos, state.mSoundIds.at(it), 1.0f, 1.0f, MWBase::SoundManager::Play_TypeSfx, MWBase::SoundManager::Play_Loop);
|
||||||
|
if (sound)
|
||||||
|
state.mSounds.push_back(sound);
|
||||||
}
|
}
|
||||||
|
|
||||||
mMagicBolts.push_back(state);
|
mMagicBolts.push_back(state);
|
||||||
|
@ -571,8 +573,10 @@ namespace MWWorld
|
||||||
|
|
||||||
for (size_t soundIter = 0; soundIter != state.mSoundIds.size(); soundIter++)
|
for (size_t soundIter = 0; soundIter != state.mSoundIds.size(); soundIter++)
|
||||||
{
|
{
|
||||||
state.mSounds.push_back(sndMgr->playSound3D(esm.mPosition, state.mSoundIds.at(soundIter), 1.0f, 1.0f,
|
MWBase::SoundPtr sound = sndMgr->playSound3D(esm.mPosition, state.mSoundIds.at(soundIter), 1.0f, 1.0f,
|
||||||
MWBase::SoundManager::Play_TypeSfx, MWBase::SoundManager::Play_Loop));
|
MWBase::SoundManager::Play_TypeSfx, MWBase::SoundManager::Play_Loop);
|
||||||
|
if (sound)
|
||||||
|
state.mSounds.push_back(sound);
|
||||||
}
|
}
|
||||||
|
|
||||||
mMagicBolts.push_back(state);
|
mMagicBolts.push_back(state);
|
||||||
|
|
Loading…
Reference in a new issue