mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:18:22 +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:
commit
4b5439f434
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user