mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 08:02:55 +08:00
Fix hard crash when opening beatmap with zero playcount in beatmap overlay
This commit is contained in:
parent
21d8a18812
commit
ebaef86432
@ -29,7 +29,10 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
if (value == beatmap) return;
|
||||
beatmap = value;
|
||||
|
||||
var rate = (float)beatmap.OnlineInfo.PassCount / beatmap.OnlineInfo.PlayCount;
|
||||
int passCount = beatmap.OnlineInfo.PassCount;
|
||||
int playCount = beatmap.OnlineInfo.PlayCount;
|
||||
|
||||
var rate = (playCount != 0) ? (float)passCount / playCount : 0;
|
||||
successPercent.Text = rate.ToString("P0");
|
||||
successRate.Length = rate;
|
||||
percentContainer.ResizeWidthTo(successRate.Length, 250, Easing.InOutCubic);
|
||||
|
Loading…
Reference in New Issue
Block a user