1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-27 06:29:54 +08:00

Merge pull request #19768 from peppy/fix-song-progress-div-by-zero

Fix div-by-zero in `SongProgress` when no object duration could be calculated
This commit is contained in:
Dan Balasescu
2022-08-15 16:44:28 +09:00
committed by GitHub
Unverified
+4 -1
View File
@@ -94,7 +94,10 @@ namespace osu.Game.Screens.Play.HUD
double objectOffsetCurrent = currentTime - FirstHitTime;
double objectDuration = LastHitTime - FirstHitTime;
UpdateProgress(objectOffsetCurrent / objectDuration, false);
if (objectDuration == 0)
UpdateProgress(0, false);
else
UpdateProgress(objectOffsetCurrent / objectDuration, false);
}
}
}