Skip to content

Commit

Permalink
Do not add extra sample control point after end of IHasRepeats objects
Browse files Browse the repository at this point in the history
  • Loading branch information
bdach committed Jul 2, 2024
1 parent 8479469 commit d4a8f6c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
19 changes: 7 additions & 12 deletions osu.Game.Tests/Resources/per-slider-node-sample-settings.osu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
osu file format v128
osu file format v128

[General]
SampleSet: Normal
Expand All @@ -7,18 +7,13 @@ SampleSet: Normal
15,1000,4,1,0,100,1,0
2271,-100,4,1,0,5,0,0
6021,-100,4,1,0,100,0,0
9515,-100,4,1,0,5,0,0
9521,-100,4,1,0,100,0,0
10265,-100,4,1,0,5,0,0
13765,-100,4,1,0,100,0,0
13771,-100,4,1,0,5,0,0
8515,-100,4,1,0,5,0,0
12765,-100,4,1,0,100,0,0
14764,-100,4,1,0,5,0,0
14770,-100,4,1,0,50,0,0
18264,-100,4,1,0,100,0,0
18270,-100,4,1,0,50,0,0
21764,-100,4,1,0,5,0,0
21770,-100,4,1,0,50,0,0
25264,-100,4,1,0,100,0,0
25270,-100,4,1,0,50,0,0
17264,-100,4,1,0,5,0,0
17270,-100,4,1,0,50,0,0
22264,-100,4,1,0,100,0,0

[HitObjects]
113,54,2265,6,0,L|422:55,1,300,0|0,1:0|1:0,1:0:0:0:
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ IEnumerable<SampleControlPoint> collectSampleControlPoints(IEnumerable<HitObject
if (hasNodeSamples.NodeSamples[i].Count > 0)
yield return createSampleControlPointFor(nodeTime, hasNodeSamples.NodeSamples[i]);

if (spanDuration > LegacyBeatmapDecoder.CONTROL_POINT_LENIENCY + 1 && hitObject.Samples.Count > 0)
if (spanDuration > LegacyBeatmapDecoder.CONTROL_POINT_LENIENCY + 1 && hitObject.Samples.Count > 0 && i < hasNodeSamples.NodeSamples.Count - 1)
yield return createSampleControlPointFor(nodeTime + LegacyBeatmapDecoder.CONTROL_POINT_LENIENCY + 1, hitObject.Samples);
}
}
Expand Down

0 comments on commit d4a8f6c

Please sign in to comment.