1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 12:22:56 +08:00

Fix gameplay samples potentially start playing while player is paused

This commit is contained in:
Salman Ahmed 2020-09-16 01:59:07 +03:00
parent 9a3a543575
commit 35c7677d0a

View File

@ -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