1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 18:33:20 +08:00

resolved nans and added stacked slider fix

This commit is contained in:
Xexxar 2021-10-17 03:56:53 +00:00
parent 30eb08d394
commit 14d405786e

View File

@ -82,19 +82,22 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing
scalingFactor *= 1 + smallCircleBonus; scalingFactor *= 1 + smallCircleBonus;
} }
double sliderAbuseIndex = 1;
if (lastObject is Slider lastSlider) if (lastObject is Slider lastSlider)
{ {
computeSliderCursorPosition(lastSlider); computeSliderCursorPosition(lastSlider);
TravelDistance = lastSlider.LazyTravelDistance * scalingFactor; sliderAbuseIndex = Math.Clamp(Vector2.Subtract(lastSlider.StackedPosition * scalingFactor, BaseObject.StackedPosition * scalingFactor).Length - 100, 0, 25) / 25;
TravelTime = Math.Max(lastSlider.LazyTravelTime / clockRate, 0); TravelDistance = lastSlider.LazyTravelDistance * scalingFactor * sliderAbuseIndex;
MovementTime = Math.Max(StrainTime - TravelTime, 0); TravelTime = Math.Max(lastSlider.LazyTravelTime / clockRate, 25);
MovementTime = Math.Max(StrainTime - TravelTime, 25);
MovementDistance = Vector2.Subtract(lastSlider.TailCircle.StackedPosition, BaseObject.StackedPosition).Length * scalingFactor; MovementDistance = Vector2.Subtract(lastSlider.TailCircle.StackedPosition, BaseObject.StackedPosition).Length * scalingFactor;
} }
Vector2 lastCursorPosition = getEndCursorPosition(lastObject); Vector2 lastCursorPosition = getEndCursorPosition(lastObject);
JumpDistance = (BaseObject.StackedPosition * scalingFactor - lastCursorPosition * scalingFactor).Length; JumpDistance = (BaseObject.StackedPosition * scalingFactor - lastCursorPosition * scalingFactor).Length * sliderAbuseIndex;
MovementDistance = Math.Min(JumpDistance, MovementDistance); MovementDistance = Math.Min(JumpDistance, MovementDistance) * sliderAbuseIndex;
if (lastLastObject != null && !(lastLastObject is Spinner)) if (lastLastObject != null && !(lastLastObject is Spinner))
{ {