Skip to content

Commit

Permalink
Fix mirror mod corrupting the valid slides list
Browse files Browse the repository at this point in the history
  • Loading branch information
LumpBloom7 committed Aug 12, 2023
1 parent e2d97af commit 0a17adf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
4 changes: 3 additions & 1 deletion osu.Game.Rulesets.Sentakki/Mods/SentakkiModMirror.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ public void ApplyToBeatmap(IBeatmap beatmap)
{
foreach (var slideInfo in slide.SlideInfoList)
{

Check notice on line 58 in osu.Game.Rulesets.Sentakki/Mods/SentakkiModMirror.cs

View check run for this annotation

codefactor.io / CodeFactor

osu.Game.Rulesets.Sentakki/Mods/SentakkiModMirror.cs#L58

An opening curly bracket must not be followed by a blank line. (SA1505)
foreach (var part in slideInfo.SlidePathParts)
for (int i = 0; i < slideInfo.SlidePathParts.Length; ++i)
{
var part = slideInfo.SlidePathParts[i];
part.EndOffset = (part.EndOffset * -1).NormalizePath();
part.Mirrored ^= mirrored;
}
Expand Down
10 changes: 1 addition & 9 deletions osu.Game.Rulesets.Sentakki/Objects/SlidePathPart.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;

namespace osu.Game.Rulesets.Sentakki.Objects
{
public class SlideBodyPart : IEquatable<SlideBodyPart>
public record struct SlideBodyPart
{
public SlidePaths.PathShapes Shape { get; private set; }
public int EndOffset { get; set; }
Expand All @@ -14,11 +12,5 @@ public SlideBodyPart(SlidePaths.PathShapes shape, int endOffset, bool mirrored)
EndOffset = endOffset;
Mirrored = mirrored;
}

public override bool Equals(object? obj) => obj is not null && obj is SlideBodyPart otherPart && Equals(otherPart);

public bool Equals(SlideBodyPart? other) => other is not null && (ReferenceEquals(this, other) || (Shape == other.Shape && EndOffset == other.EndOffset));

public override int GetHashCode() => HashCode.Combine(Shape, EndOffset, Mirrored);
}
}

0 comments on commit 0a17adf

Please sign in to comment.