mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 05:53:10 +08:00
Allow legacy score to be constructed even if replay file is missing
This commit is contained in:
parent
c3c5a99a22
commit
90d69c1216
@ -16,7 +16,10 @@ namespace osu.Game.Scoring
|
|||||||
{
|
{
|
||||||
ScoreInfo = score;
|
ScoreInfo = score;
|
||||||
|
|
||||||
var replayFilename = score.Files.First(f => f.Filename.EndsWith(".osr", StringComparison.InvariantCultureIgnoreCase)).FileInfo.StoragePath;
|
var replayFilename = score.Files.FirstOrDefault(f => f.Filename.EndsWith(".osr", StringComparison.InvariantCultureIgnoreCase))?.FileInfo.StoragePath;
|
||||||
|
|
||||||
|
if (replayFilename == null)
|
||||||
|
return;
|
||||||
|
|
||||||
using (var stream = store.GetStream(replayFilename))
|
using (var stream = store.GetStream(replayFilename))
|
||||||
Replay = new DatabasedLegacyScoreDecoder(rulesets, beatmaps).Parse(stream).Replay;
|
Replay = new DatabasedLegacyScoreDecoder(rulesets, beatmaps).Parse(stream).Replay;
|
||||||
|
Loading…
Reference in New Issue
Block a user