From c2f2a1f8f611be9c2bf10ca59a567732b3fcc48e Mon Sep 17 00:00:00 2001 From: jonas Date: Mon, 18 Feb 2019 23:06:59 +0100 Subject: [PATCH] Exception handling for applying 3D position to sounds --- src/STACK/Components/Audio/AudioManager.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/STACK/Components/Audio/AudioManager.cs b/src/STACK/Components/Audio/AudioManager.cs index 68f9d3c..3a754c6 100644 --- a/src/STACK/Components/Audio/AudioManager.cs +++ b/src/STACK/Components/Audio/AudioManager.cs @@ -319,7 +319,14 @@ public SoundEffectInstance PlaySoundEffect(string soundEffect, bool looped = fal Instance.IsLooped = looped; if (null != emitter && null != listener) { - Instance.Apply3D(listener.Listener, emitter.Emitter); + try + { + Instance.Apply3D(listener.Listener, emitter.Emitter); + } + catch (AccessViolationException) + { + + } }