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 instant spinners giving insane amounts of strain #15009

Merged
merged 4 commits into from
Oct 15, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public OsuDifficultyHitObject(HitObject hitObject, HitObject lastLastObject, Hit

private void setDistances()
{
// We don't need to calculate neither angle nor distance when one of the last->curr objects is a spinner
stanriders marked this conversation as resolved.
Show resolved Hide resolved
if (BaseObject is Spinner || lastObject is Spinner)
return;

// We will scale distances by this factor, so we can assume a uniform CircleSize among beatmaps.
float scalingFactor = normalized_radius / (float)BaseObject.Radius;

Expand All @@ -71,11 +75,9 @@ private void setDistances()

Vector2 lastCursorPosition = getEndCursorPosition(lastObject);

// Don't need to jump to reach spinners
if (!(BaseObject is Spinner))
JumpDistance = (BaseObject.StackedPosition * scalingFactor - lastCursorPosition * scalingFactor).Length;
JumpDistance = (BaseObject.StackedPosition * scalingFactor - lastCursorPosition * scalingFactor).Length;

if (lastLastObject != null)
if (lastLastObject != null && !(lastLastObject is Spinner))
{
Vector2 lastLastCursorPosition = getEndCursorPosition(lastLastObject);

Expand Down