1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-14 00:53:19 +08:00

Fix Max lookup methods not checking for zero beatmap count

This commit is contained in:
Dean Herbert 2021-12-21 16:37:29 +09:00
parent dcd69e852e
commit 0793b0f0ab

View File

@ -50,11 +50,11 @@ namespace osu.Game.Beatmaps
/// </summary> /// </summary>
public bool Protected { get; set; } public bool Protected { get; set; }
public double MaxStarDifficulty => Beatmaps.Max(b => b.StarRating); public double MaxStarDifficulty => Beatmaps.Count == 0 ? 0 : Beatmaps.Max(b => b.StarRating);
public double MaxLength => Beatmaps.Max(b => b.Length); public double MaxLength => Beatmaps.Count == 0 ? 0 : Beatmaps.Max(b => b.Length);
public double MaxBPM => Beatmaps.Max(b => b.BPM); public double MaxBPM => Beatmaps.Count == 0 ? 0 : Beatmaps.Max(b => b.BPM);
/// <summary> /// <summary>
/// Returns the storage path for the file in this beatmapset with the given filename, if any exists, otherwise null. /// Returns the storage path for the file in this beatmapset with the given filename, if any exists, otherwise null.