From 2768fc88e7d5feeff5f80366cd2b4c877aa9b608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 25 Apr 2015 15:45:46 +0200 Subject: [PATCH] stop all sounds on map change --- OpenRA.Game/Sound/Sound.cs | 5 +++++ OpenRA.Game/World.cs | 1 + 2 files changed, 6 insertions(+) diff --git a/OpenRA.Game/Sound/Sound.cs b/OpenRA.Game/Sound/Sound.cs index 0240737948..2dfa54b18b 100644 --- a/OpenRA.Game/Sound/Sound.cs +++ b/OpenRA.Game/Sound/Sound.cs @@ -113,6 +113,11 @@ namespace OpenRA InternalSoundVolume * volumeModifier, true); } + public static void StopAudio() + { + soundEngine.StopAllSounds(); + } + public static ISound Play(string name) { return Play(null, name, true, WPos.Zero, 1f); } public static ISound Play(string name, WPos pos) { return Play(null, name, false, pos, 1f); } public static ISound Play(string name, float volumeModifier) { return Play(null, name, true, WPos.Zero, volumeModifier); } diff --git a/OpenRA.Game/World.cs b/OpenRA.Game/World.cs index 89dd4dd561..16ed7023d8 100644 --- a/OpenRA.Game/World.cs +++ b/OpenRA.Game/World.cs @@ -387,6 +387,7 @@ namespace OpenRA frameEndActions.Clear(); + Sound.StopAudio(); Sound.StopMusic(); Sound.StopVideo();