mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 14:17:26 +08:00
Reset KeyCounter if targetState was not found
This commit is contained in:
parent
5aff19eaea
commit
7a1fdd9dc8
@ -136,7 +136,11 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetCount() => CountPresses = 0;
|
||||
public void ResetCount()
|
||||
{
|
||||
CountPresses = 0;
|
||||
states.Clear();
|
||||
}
|
||||
|
||||
public void SaveState()
|
||||
{
|
||||
@ -155,6 +159,12 @@ namespace osu.Game.Screens.Play
|
||||
public void RestoreState(double time)
|
||||
{
|
||||
var targetState = states.LastOrDefault(state => state.Time <= time);
|
||||
if (targetState == null)
|
||||
{
|
||||
ResetCount();
|
||||
return;
|
||||
}
|
||||
|
||||
var targetIndex = states.IndexOf(targetState);
|
||||
|
||||
states.RemoveRange(targetIndex + 1, states.Count - (targetIndex + 1));
|
||||
|
Loading…
Reference in New Issue
Block a user