Fire sound fix: the sounds were freed after each round without ever loading them again. The sound objects still existed and had some buffer ID assigned though, causing an incorrect clip to be played or OpenAL errors to be thrown on successive rounds. (Now freed sounds always have a buffer ID of -1)
This commit is contained in:
@@ -66,10 +66,10 @@ namespace Barotrauma
|
||||
hull = Hull.FindHull(worldPosition, spawningHull);
|
||||
if (hull == null || (!networkEvent && GameMain.Client!=null)) return;
|
||||
|
||||
if (fireSoundBasic==null)
|
||||
if (fireSoundBasic == null)
|
||||
{
|
||||
fireSoundBasic = Sound.Load("Content/Sounds/fire.ogg");
|
||||
fireSoundLarge = Sound.Load("Content/Sounds/firelarge.ogg");
|
||||
fireSoundBasic = Sound.Load("Content/Sounds/fire.ogg", false);
|
||||
fireSoundLarge = Sound.Load("Content/Sounds/firelarge.ogg", false);
|
||||
}
|
||||
|
||||
hull.AddFireSource(this, !networkEvent);
|
||||
@@ -78,13 +78,8 @@ namespace Barotrauma
|
||||
|
||||
this.position = worldPosition - new Vector2(-5.0f, 5.0f) - Submarine.Position;
|
||||
|
||||
|
||||
lightSource = new LightSource(this.position, 50.0f, new Color(1.0f, 0.9f, 0.7f), hull == null ? null : hull.Submarine);
|
||||
|
||||
|
||||
|
||||
//this.position.Y = hull.Rect.Y - hull.Rect.Height;
|
||||
|
||||
|
||||
size = new Vector2(10.0f, 10.0f);
|
||||
}
|
||||
|
||||
@@ -356,12 +351,12 @@ namespace Barotrauma
|
||||
|
||||
lightSource.Remove();
|
||||
|
||||
if (basicSoundIndex > -1)
|
||||
if (basicSoundIndex > 0)
|
||||
{
|
||||
Sounds.SoundManager.Stop(basicSoundIndex);
|
||||
basicSoundIndex = -1;
|
||||
}
|
||||
if (largeSoundIndex > -1)
|
||||
if (largeSoundIndex > 0)
|
||||
{
|
||||
Sounds.SoundManager.Stop(largeSoundIndex);
|
||||
largeSoundIndex = -1;
|
||||
|
||||
Reference in New Issue
Block a user