diff options
author | Joerg Mueller <nexyon@gmail.com> | 2011-09-07 01:02:26 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2011-09-07 01:02:26 +0400 |
commit | 813d09cb5904bd435a6eefa328314d3cb9076be8 (patch) | |
tree | fb483a45a72fb995bdf57e9173aa7ce09ace5a22 /source/gameengine/Ketsji | |
parent | 53671577a4ead5e96889a5fcd5a04255f8c948de (diff) |
BGE fix: ignore sounds that cannot be opened instead of crashing. ;-)
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/KX_SoundActuator.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index 6c7b515c095..f24243fcdfc 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -108,7 +108,15 @@ void KX_SoundActuator::play() break; } - m_handle = AUD_getDevice()->play(sound, 0); + try + { + m_handle = AUD_getDevice()->play(sound, 0); + } + catch(AUD_Exception&) + { + // cannot play back, ignore + return; + } AUD_Reference<AUD_I3DHandle> handle3d = AUD_Reference<AUD_I3DHandle>(m_handle); |