From 53a7d919c769b729ad856972c844366e440248e1 Mon Sep 17 00:00:00 2001 From: HoLLy Date: Sat, 15 Jun 2019 22:41:10 +0200 Subject: [PATCH] Clarify speedRequired --- osu.Game.Rulesets.Catch/Replays/CatchAutoGenerator.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/Replays/CatchAutoGenerator.cs b/osu.Game.Rulesets.Catch/Replays/CatchAutoGenerator.cs index e7e9c5b003..d418e7278a 100644 --- a/osu.Game.Rulesets.Catch/Replays/CatchAutoGenerator.cs +++ b/osu.Game.Rulesets.Catch/Replays/CatchAutoGenerator.cs @@ -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;