(d9829ac) v0.9.4.0
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user