Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix slider MinimumJumpDistance being calculated too low to be possible #30036

Open
wants to merge 6 commits into
base: pp-dev
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,23 @@ private void setDistances(double clockRate)

float tailJumpDistance = Vector2.Subtract(lastSlider.TailCircle.StackedPosition, BaseObject.StackedPosition).Length * scalingFactor;
MinimumJumpDistance = Math.Max(0, Math.Min(LazyJumpDistance - (maximum_slider_radius - assumed_slider_radius), tailJumpDistance - maximum_slider_radius));

float distanceBetweenStartPositions = (BaseObject.StackedPosition * scalingFactor - lastObject.StackedPosition * scalingFactor).Length;

if (MinimumJumpDistance < distanceBetweenStartPositions)
{
// MinimumJumpDistance can be sometimes calculated to be ~0 in cases where the player wouldn't move the cursor anywhere and treat the slider as just a normal circle.
//
// o---<s===> ← slider (s - start, length smaller than the followcircle)
// ↑
// next object
//
// In this case MinimumJumpDistance is calculated to be less than the jump from start of the object to the start of the next one which is impossible.
// Therefore, we set minimal distance and time to be that of a normal start-to-start jump.

MinimumJumpTime = StrainTime;
MinimumJumpDistance = Math.Min(LazyJumpDistance, distanceBetweenStartPositions);
}
}

if (lastLastObject != null && !(lastLastObject is Spinner))
Expand Down
Loading