1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-20 05:19:55 +08:00

Fix hard crash when opening beatmap with zero playcount in beatmap overlay

This commit is contained in:
EVAST9919
2017-11-06 21:28:01 +03:00
Unverified
parent 21d8a18812
commit ebaef86432
+4 -1
View File
@@ -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);