Fix div-by-zero in SongProgress when no object duration could be calculated

This commit is contained in:
Dean Herbert 2022-08-15 15:05:35 +09:00
parent 0d3cda3329
commit 623e90a7b2

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