mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 03:42:57 +08:00
Add precautionary guard to avoid potential div-by-zero
Probably wouldn't happen outside of tests, but I'd rather not find out next release.
This commit is contained in:
parent
e02ad6cf94
commit
0b29a762b8
@ -97,7 +97,8 @@ namespace osu.Game.Graphics.Containers
|
||||
// This means that the amount of early adjustment is adjusted in line with audio track rate changes.
|
||||
// But other cases like the osu! logo at the main menu won't correctly have this rate information.
|
||||
// We can adjust here to ensure the applied early activation always matches expectations.
|
||||
early *= BeatSyncSource.Clock.Rate / Clock.Rate;
|
||||
if (Clock.Rate > 0)
|
||||
early *= BeatSyncSource.Clock.Rate / Clock.Rate;
|
||||
|
||||
currentTrackTime = BeatSyncSource.Clock.CurrentTime + early;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user