1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 15:33:05 +08:00

Reset KeyCounter if targetState was not found

This commit is contained in:
Roman Kapustin 2018-09-06 01:01:36 +03:00
parent 5aff19eaea
commit 7a1fdd9dc8

View File

@ -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));