1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 16:02:55 +08:00

Add comment specifically about infinity being ok

This commit is contained in:
Dean Herbert 2019-06-16 05:57:52 +09:00 committed by GitHub
parent 53a7d919c7
commit 1916fdd247
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,7 +44,8 @@ namespace osu.Game.Rulesets.Catch.Replays
double timeAvailable = h.StartTime - lastTime;
// So we can either make it there without a dash or not.
// If positionChange is 0, we don't need to move so speedRequired should also be 0 (could be NaN if timeAvailable is 0 too)
// If positionChange is 0, we don't need to move, so speedRequired should also be 0 (could be NaN if timeAvailable is 0 too)
// The case where positionChange > 0 and timeAvailable == 0 results in PositiveInfinity which provides expected beheaviour.
double speedRequired = positionChange == 0 ? 0 : positionChange / timeAvailable;
bool dashRequired = speedRequired > movement_speed;