From c3b8f2a1dbc29e4a80d38aa90698ebdacc9ce0ad Mon Sep 17 00:00:00 2001 From: Regalis Date: Mon, 27 Feb 2017 19:02:33 +0200 Subject: [PATCH] Fixed OpenAL errors when removing looping sounds The sounds didn't save their source id in the Sound.Loop method, so they couldn't stop the playback upon removal which caused errors when unbinding and deleting the (still playing) sound buffer --- Subsurface/Source/Sounds/Sound.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Subsurface/Source/Sounds/Sound.cs b/Subsurface/Source/Sounds/Sound.cs index a334f59b4..9ce6c8079 100644 --- a/Subsurface/Source/Sounds/Sound.cs +++ b/Subsurface/Source/Sounds/Sound.cs @@ -198,8 +198,8 @@ namespace Barotrauma return sourceIndex; } - return SoundManager.Loop(this, sourceIndex, relativePos/100.0f, volume); - + alSourceId = SoundManager.Loop(this, sourceIndex, relativePos / 100.0f, volume); + return alSourceId; } public bool IsPlaying