Clarify speedRequired

This commit is contained in:
HoLLy 2019-06-15 22:41:10 +02:00 committed by GitHub
parent c723ec5a9d
commit 53a7d919c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -43,7 +43,8 @@ void moveToNext(CatchHitObject h)
float positionChange = Math.Abs(lastPosition - h.X);
double timeAvailable = h.StartTime - lastTime;
//So we can either make it there without a dash or not.
// 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)
double speedRequired = positionChange == 0 ? 0 : positionChange / timeAvailable;
bool dashRequired = speedRequired > movement_speed;