(d9829ac) v0.9.4.0

This commit is contained in:
Regalis
2019-10-24 18:05:42 +02:00
parent 9aa12bcac2
commit b39922a074
319 changed files with 12516 additions and 6815 deletions
@@ -289,8 +289,11 @@ namespace Barotrauma.Sounds
get
{
if (!IsPlaying) { return 0.0f; }
uint alSource = Sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex);
if (alSource == 0) { return 0.0f; }
if (!IsStream)
{
int playbackPos; Al.GetSourcei(alSource, Al.SampleOffset, out playbackPos);
@@ -116,10 +116,15 @@ namespace Barotrauma
foreach (string soundFile in soundFiles)
{
XDocument doc = XMLExtensions.TryLoadXml(soundFile);
if (doc != null && doc.Root != null)
if (doc == null) { continue; }
var mainElement = doc.Root;
if (doc.Root.IsOverride())
{
soundElements.AddRange(doc.Root.Elements());
mainElement = doc.Root.FirstElement();
DebugConsole.NewMessage($"Overriding all sounds with {soundFile}", Color.Yellow);
soundElements.Clear();
}
soundElements.AddRange(mainElement.Elements());
}
SoundCount = 1 + soundElements.Count();