1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 16:02:55 +08:00

Fix delete local scores crashing the game

This commit is contained in:
Dean Herbert 2022-01-28 15:08:39 +09:00
parent 2453bf5ed0
commit 0d3ac4fd9c
2 changed files with 10 additions and 1 deletions

View File

@ -266,6 +266,15 @@ namespace osu.Game.Scoring
});
}
public void Delete(BeatmapInfo beatmap, bool silent = false)
{
realm.Run(r =>
{
var beatmapScores = r.Find<BeatmapInfo>(beatmap.ID).Scores.ToList();
scoreModelManager.Delete(beatmapScores, silent);
});
}
public void Delete(List<ScoreInfo> items, bool silent = false)
{
scoreModelManager.Delete(items, silent);

View File

@ -28,7 +28,7 @@ namespace osu.Game.Screens.Select
Text = @"Yes. Please.",
Action = () =>
{
Task.Run(() => scoreManager.Delete(s => !s.DeletePending && s.BeatmapInfo.ID == beatmapInfo.ID))
Task.Run(() => scoreManager.Delete(beatmapInfo))
.ContinueWith(_ => onCompletion);
}
},