Skip to content

Commit

Permalink
Fix old looping samples not stopping when replacing a `SkinnableSound…
Browse files Browse the repository at this point in the history
…`'s `Samples`

Closes ppy#30365.
  • Loading branch information
bdach committed Oct 22, 2024
1 parent 53a3409 commit 1008d32
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions osu.Game/Skinning/SkinnableSound.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ private void updateSamples()
{
bool wasPlaying = IsPlaying;

if (wasPlaying && Looping)
Stop();

// Remove all pooled samples (return them to the pool), and dispose the rest.
samplesContainer.RemoveAll(s => s.IsInPool, false);
samplesContainer.Clear();
Expand Down

0 comments on commit 1008d32

Please sign in to comment.