mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 13:42:56 +08:00
Don't load player if score has no replay data
This commit is contained in:
parent
059e9e180b
commit
ed67984638
@ -267,15 +267,17 @@ namespace osu.Game
|
||||
return;
|
||||
}
|
||||
|
||||
var databasedBeatmap = BeatmapManager.QueryBeatmap(b => b.ID == score.Beatmap.ID);
|
||||
var score = ScoreManager.GetScore(scoreInfo);
|
||||
if (score.Replay == null)
|
||||
{
|
||||
Logger.Log("The loaded score has no replay data.", LoggingTarget.Information);
|
||||
return;
|
||||
}
|
||||
|
||||
var databasedBeatmap = BeatmapManager.QueryBeatmap(b => b.ID == scoreInfo.BeatmapInfo.ID);
|
||||
if (databasedBeatmap == null)
|
||||
{
|
||||
notifications.Post(new SimpleNotification
|
||||
{
|
||||
Text = @"Tried to load a score for a beatmap we don't have!",
|
||||
Icon = FontAwesome.fa_life_saver,
|
||||
});
|
||||
Logger.Log("Tried to load a score for a beatmap we don't have!", LoggingTarget.Information);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -284,7 +286,7 @@ namespace osu.Game
|
||||
Beatmap.Value = BeatmapManager.GetWorkingBeatmap(databasedBeatmap);
|
||||
Beatmap.Value.Mods.Value = score.Mods;
|
||||
|
||||
menu.Push(new PlayerLoader(new ReplayPlayer(ScoreManager.GetScore(score).Replay)));
|
||||
menu.Push(new PlayerLoader(new ReplayPlayer(score.Replay)));
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
|
Loading…
Reference in New Issue
Block a user