1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 13:22:55 +08:00

Fix crash when loading results after gameplay (#6886)

Fix crash when loading results after gameplay
This commit is contained in:
Dean Herbert 2019-11-20 15:52:09 +09:00 committed by GitHub
commit 74c034aee8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -183,6 +183,10 @@ namespace osu.Game.Scoring
public override string ToString() => $"{User} playing {Beatmap}";
public bool Equals(ScoreInfo other) => other?.OnlineScoreID == OnlineScoreID;
public bool Equals(ScoreInfo other) =>
other != null
&& other.OnlineScoreID == OnlineScoreID
&& other.BeatmapInfoID == BeatmapInfoID
&& other.Hash == Hash;
}
}

View File

@ -69,6 +69,6 @@ namespace osu.Game.Scoring
protected override ArchiveDownloadRequest<ScoreInfo> CreateDownloadRequest(ScoreInfo score, bool minimiseDownload) => new DownloadReplayRequest(score);
protected override bool CheckLocalAvailability(ScoreInfo model, IQueryable<ScoreInfo> items) => items.Any(s => s.OnlineScoreID == model.OnlineScoreID && s.Files.Any());
protected override bool CheckLocalAvailability(ScoreInfo model, IQueryable<ScoreInfo> items) => items.Any(s => s.Equals(model) && s.Files.Any());
}
}