1
0
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:
Dan Balasescu 2022-08-15 16:44:28 +09:00 committed by GitHub
commit 4b5439f434
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);
}
}
}