mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 02:42:54 +08:00
Fix HitObject samples getting stuck in a playing state on seeking far into the future
This commit is contained in:
parent
56c8e4dacf
commit
5d1c377379
@ -110,6 +110,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void StopAllSamples()
|
||||||
|
{
|
||||||
|
base.StopAllSamples();
|
||||||
|
slidingSample?.Stop();
|
||||||
|
}
|
||||||
|
|
||||||
private void updateSlidingSample(ValueChangedEvent<bool> tracking)
|
private void updateSlidingSample(ValueChangedEvent<bool> tracking)
|
||||||
{
|
{
|
||||||
if (tracking.NewValue)
|
if (tracking.NewValue)
|
||||||
|
@ -124,6 +124,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void StopAllSamples()
|
||||||
|
{
|
||||||
|
base.StopAllSamples();
|
||||||
|
spinningSample?.Stop();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void AddNestedHitObject(DrawableHitObject hitObject)
|
protected override void AddNestedHitObject(DrawableHitObject hitObject)
|
||||||
{
|
{
|
||||||
base.AddNestedHitObject(hitObject);
|
base.AddNestedHitObject(hitObject);
|
||||||
|
@ -387,6 +387,11 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stops playback of all samples. Automatically called when <see cref="DrawableHitObject{TObject}"/>'s lifetime has been exceeded.
|
||||||
|
/// </summary>
|
||||||
|
public virtual void StopAllSamples() => Samples?.Stop();
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
@ -455,6 +460,8 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
foreach (var nested in NestedHitObjects)
|
foreach (var nested in NestedHitObjects)
|
||||||
nested.OnKilled();
|
nested.OnKilled();
|
||||||
|
|
||||||
|
StopAllSamples();
|
||||||
|
|
||||||
UpdateResult(false);
|
UpdateResult(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,8 @@ namespace osu.Game.Skinning
|
|||||||
// it's not easy to know if a sample has finished playing (to end).
|
// it's not easy to know if a sample has finished playing (to end).
|
||||||
// to keep things simple only resume playing looping samples.
|
// to keep things simple only resume playing looping samples.
|
||||||
else if (Looping)
|
else if (Looping)
|
||||||
play();
|
// schedule so we don't start playing a sample which is no longer alive.
|
||||||
|
Schedule(play);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user