Unstable 0.17.7.0
This commit is contained in:
@@ -372,13 +372,10 @@ namespace Barotrauma.Sounds
|
||||
}
|
||||
|
||||
var newSound = new OggSound(this, filePath, stream, xElement: element);
|
||||
if (newSound != null)
|
||||
{
|
||||
newSound.BaseGain = element.GetAttributeFloat("volume", 1.0f);
|
||||
float range = element.GetAttributeFloat("range", 1000.0f);
|
||||
newSound.BaseNear = range * 0.4f;
|
||||
newSound.BaseFar = range;
|
||||
}
|
||||
newSound.BaseGain = element.GetAttributeFloat("volume", 1.0f);
|
||||
float range = element.GetAttributeFloat("range", 1000.0f);
|
||||
newSound.BaseNear = range * 0.4f;
|
||||
newSound.BaseFar = range;
|
||||
|
||||
lock (loadedSounds)
|
||||
{
|
||||
|
||||
@@ -178,6 +178,7 @@ namespace Barotrauma
|
||||
SoundChannel chn = waterAmbienceChannels.FirstOrDefault(c => c.Sound == sound);
|
||||
if (chn is null || !chn.IsPlaying)
|
||||
{
|
||||
if (volume < 0.01f) { return; }
|
||||
if (!(chn is null)) { waterAmbienceChannels.Remove(chn); }
|
||||
chn = sound.Play(volume, "waterambience");
|
||||
chn.Looping = true;
|
||||
|
||||
@@ -202,6 +202,11 @@ namespace Barotrauma
|
||||
{
|
||||
Sound?.Dispose(); Sound = null;
|
||||
}
|
||||
|
||||
~SoundPrefab()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
[TagNames("damagesound")]
|
||||
|
||||
Reference in New Issue
Block a user