aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-05-18 19:14:07 -0400
committerMichael <[email protected]>2017-05-18 19:14:07 -0400
commit2e36fa7197d01f7cfb22f95a5ea8be2ff62feecb (patch)
treefd2dbb69425201936e2e720152549c967a149094
parent46a92866f8ac757bd236746be7ed11a1a0c39f86 (diff)
downloadshiftos_thereturn-2e36fa7197d01f7cfb22f95a5ea8be2ff62feecb.tar.gz
shiftos_thereturn-2e36fa7197d01f7cfb22f95a5ea8be2ff62feecb.tar.bz2
shiftos_thereturn-2e36fa7197d01f7cfb22f95a5ea8be2ff62feecb.zip
fix MANY AUDIO BUGS
-rw-r--r--ShiftOS_TheReturn/AudioManager.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/ShiftOS_TheReturn/AudioManager.cs b/ShiftOS_TheReturn/AudioManager.cs
index fff3369..553a1d9 100644
--- a/ShiftOS_TheReturn/AudioManager.cs
+++ b/ShiftOS_TheReturn/AudioManager.cs
@@ -88,17 +88,17 @@ namespace ShiftOS.Engine
_reader = new AudioFileReader(file);
_out = new WaveOut();
_out.Init(_reader);
- try
- {
- _out.Volume = (float)SaveSystem.CurrentSave.SfxVolume / 100;
- }
- catch
- {
- }
_out.Play();
+ if (SaveSystem.CurrentSave == null)
+ _out.Volume = 1.0f;
+ else
+ _out.Volume = (float)SaveSystem.CurrentSave.MusicVolume / 100;
_out.PlaybackStopped += (o, a) => { PlayCompleted?.Invoke(); };
}
- catch { }
+ catch(Exception ex)
+ {
+ Console.WriteLine("Audio error: " + ex.Message);
+ }
}
/// <summary>