From 35c7677d0a0996d4df518aa6da5c7b464f0059a3 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Wed, 16 Sep 2020 01:59:07 +0300 Subject: [PATCH] Fix gameplay samples potentially start playing while player is paused --- osu.Game/Skinning/SkinnableSound.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/osu.Game/Skinning/SkinnableSound.cs b/osu.Game/Skinning/SkinnableSound.cs index cf629f231f..9e49134806 100644 --- a/osu.Game/Skinning/SkinnableSound.cs +++ b/osu.Game/Skinning/SkinnableSound.cs @@ -114,6 +114,8 @@ namespace osu.Game.Skinning protected override void SkinChanged(ISkinSource skin, bool allowFallback) { + bool wasPlaying = IsPlaying; + var channels = hitSamples.Select(s => { var ch = skin.GetSample(s); @@ -138,8 +140,10 @@ namespace osu.Game.Skinning samplesContainer.ChildrenEnumerable = channels.Select(c => new DrawableSample(c)); - if (requestedPlaying) - Play(); + // Sample channels have been reloaded to new ones because skin has changed. + // Start playback internally for them if they were playing previously. + if (wasPlaying) + play(); } #region Re-expose AudioContainer