mirror of
https://github.com/ppy/osu.git
synced 2025-01-08 06:52:59 +08:00
Fix instant spinners giving insane amounts of strain
This commit is contained in:
parent
17e0498860
commit
b72b071c25
@ -69,23 +69,26 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing
|
|||||||
TravelDistance = lastSlider.LazyTravelDistance * scalingFactor;
|
TravelDistance = lastSlider.LazyTravelDistance * scalingFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 lastCursorPosition = getEndCursorPosition(lastObject);
|
if (!(lastObject is Spinner))
|
||||||
|
|
||||||
// Don't need to jump to reach spinners
|
|
||||||
if (!(BaseObject is Spinner))
|
|
||||||
JumpDistance = (BaseObject.StackedPosition * scalingFactor - lastCursorPosition * scalingFactor).Length;
|
|
||||||
|
|
||||||
if (lastLastObject != null)
|
|
||||||
{
|
{
|
||||||
Vector2 lastLastCursorPosition = getEndCursorPosition(lastLastObject);
|
Vector2 lastCursorPosition = getEndCursorPosition(lastObject);
|
||||||
|
|
||||||
Vector2 v1 = lastLastCursorPosition - lastObject.StackedPosition;
|
// Don't need to jump to reach spinners
|
||||||
Vector2 v2 = BaseObject.StackedPosition - lastCursorPosition;
|
if (!(BaseObject is Spinner))
|
||||||
|
JumpDistance = (BaseObject.StackedPosition * scalingFactor - lastCursorPosition * scalingFactor).Length;
|
||||||
|
|
||||||
float dot = Vector2.Dot(v1, v2);
|
if (lastLastObject != null)
|
||||||
float det = v1.X * v2.Y - v1.Y * v2.X;
|
{
|
||||||
|
Vector2 lastLastCursorPosition = getEndCursorPosition(lastLastObject);
|
||||||
|
|
||||||
Angle = Math.Abs(Math.Atan2(det, dot));
|
Vector2 v1 = lastLastCursorPosition - lastObject.StackedPosition;
|
||||||
|
Vector2 v2 = BaseObject.StackedPosition - lastCursorPosition;
|
||||||
|
|
||||||
|
float dot = Vector2.Dot(v1, v2);
|
||||||
|
float det = v1.X * v2.Y - v1.Y * v2.X;
|
||||||
|
|
||||||
|
Angle = Math.Abs(Math.Atan2(det, dot));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user