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

Ensure looping is disabled on old samples when switching skins

This commit is contained in:
Dean Herbert 2021-03-19 15:34:19 +09:00
parent 0e821e857e
commit bf4317d3f0

View File

@ -83,6 +83,14 @@ namespace osu.Game.Skinning
bool wasPlaying = Playing;
if (activeChannel != null)
{
// when switching away from previous samples, we don't want to call Stop() on them as it sounds better to let them play out.
// this may change in the future if we use PoolableSkinSample in more locations than gameplay.
// we *do* want to turn off looping, else we end up with an infinite looping sample running in the background.
activeChannel.Looping = false;
}
sampleContainer.Clear();
Sample = null;