1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 14:42:56 +08:00

Ensure FailAnimation can't be Started after filters are already removed

This commit is contained in:
Dean Herbert 2022-08-25 14:26:20 +09:00
parent 136dcee3b5
commit 4c45f7d938

View File

@ -105,6 +105,7 @@ namespace osu.Game.Screens.Play
}
private bool started;
private bool filtersRemoved;
/// <summary>
/// Start the fail animation playing.
@ -113,6 +114,7 @@ namespace osu.Game.Screens.Play
public void Start()
{
if (started) throw new InvalidOperationException("Animation cannot be started more than once.");
if (filtersRemoved) throw new InvalidOperationException("Animation cannot be started after filters have been removed.");
started = true;
@ -155,6 +157,11 @@ namespace osu.Game.Screens.Play
public void RemoveFilters(bool resetTrackFrequency = true)
{
if (filtersRemoved)
return;
filtersRemoved = true;
if (resetTrackFrequency)
track?.RemoveAdjustment(AdjustableProperty.Frequency, trackFreq);