Skip to content

Commit

Permalink
Fix random mod needlessly trying to fix nested object positions on it…
Browse files Browse the repository at this point in the history
…s own
  • Loading branch information
bdach committed Sep 27, 2024
1 parent 1c23fd3 commit 89f47c4
Showing 1 changed file with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ private static Vector2 clampSliderToPlayfield(WorkingObject workingObject)
slider.Position = workingObject.PositionModified = new Vector2(newX, newY);
workingObject.EndPositionModified = slider.EndPosition;

shiftNestedObjects(slider, workingObject.PositionModified - workingObject.PositionOriginal);

return workingObject.PositionModified - previousPosition;
}

Expand Down Expand Up @@ -307,22 +305,6 @@ public static RectangleF CalculatePossibleMovementBounds(Slider slider)
return new RectangleF(left, top, right - left, bottom - top);
}

/// <summary>
/// Shifts all nested <see cref="SliderTick"/>s and <see cref="SliderRepeat"/>s by the specified shift.
/// </summary>
/// <param name="slider"><see cref="Slider"/> whose nested <see cref="SliderTick"/>s and <see cref="SliderRepeat"/>s should be shifted</param>
/// <param name="shift">The <see cref="Vector2"/> the <see cref="Slider"/>'s nested <see cref="SliderTick"/>s and <see cref="SliderRepeat"/>s should be shifted by</param>
private static void shiftNestedObjects(Slider slider, Vector2 shift)
{
foreach (var hitObject in slider.NestedHitObjects.Where(o => o is SliderTick || o is SliderRepeat))
{
if (!(hitObject is OsuHitObject osuHitObject))
continue;

osuHitObject.Position += shift;
}
}

/// <summary>
/// Clamp a position to playfield, keeping a specified distance from the edges.
/// </summary>
Expand Down

0 comments on commit 89f47c4

Please sign in to comment.