Skip to content

Commit 8aed578

Browse files
authored
Merge pull request #30509 from bdach/encode-0-01-svs
Fix effect point scroll speeds below 0.1x not being encoded properly
2 parents 5db52e1 + 23f3890 commit 8aed578

File tree

3 files changed

+53
-4
lines changed

3 files changed

+53
-4
lines changed

osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapEncoderTest.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ static ControlPointInfo removeLegacyControlPointTypes(ControlPointInfo controlPo
120120
private void compareBeatmaps((IBeatmap beatmap, TestLegacySkin skin) expected, (IBeatmap beatmap, TestLegacySkin skin) actual)
121121
{
122122
// Check all control points that are still considered to be at a global level.
123-
Assert.That(expected.beatmap.ControlPointInfo.TimingPoints.Serialize(), Is.EqualTo(actual.beatmap.ControlPointInfo.TimingPoints.Serialize()));
124-
Assert.That(expected.beatmap.ControlPointInfo.EffectPoints.Serialize(), Is.EqualTo(actual.beatmap.ControlPointInfo.EffectPoints.Serialize()));
123+
Assert.That(actual.beatmap.ControlPointInfo.TimingPoints.Serialize(), Is.EqualTo(expected.beatmap.ControlPointInfo.TimingPoints.Serialize()));
124+
Assert.That(actual.beatmap.ControlPointInfo.EffectPoints.Serialize(), Is.EqualTo(expected.beatmap.ControlPointInfo.EffectPoints.Serialize()));
125125

126126
// Check all hitobjects.
127-
Assert.That(expected.beatmap.HitObjects.Serialize(), Is.EqualTo(actual.beatmap.HitObjects.Serialize()));
127+
Assert.That(actual.beatmap.HitObjects.Serialize(), Is.EqualTo(expected.beatmap.HitObjects.Serialize()));
128128

129129
// Check skin.
130130
Assert.IsTrue(areComboColoursEqual(expected.skin.Configuration, actual.skin.Configuration));
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
osu file format v14
2+
3+
[General]
4+
SampleSet: Normal
5+
StackLeniency: 0.7
6+
Mode: 3
7+
8+
[Difficulty]
9+
HPDrainRate:3
10+
CircleSize:5
11+
OverallDifficulty:8
12+
ApproachRate:8
13+
SliderMultiplier:3.59999990463257
14+
SliderTickRate:2
15+
16+
[TimingPoints]
17+
24,352.941176470588,4,1,1,100,1,0
18+
6376,-10000,4,1,1,100,0,0
19+
20+
[HitObjects]
21+
51,192,24,1,0,0:0:0:0:
22+
153,192,200,1,0,0:0:0:0:
23+
358,192,376,1,0,0:0:0:0:
24+
460,192,553,1,0,0:0:0:0:
25+
460,192,729,128,0,1435:0:0:0:0:
26+
358,192,906,128,0,1612:0:0:0:0:
27+
256,192,1082,128,0,1788:0:0:0:0:
28+
153,192,1259,128,0,1965:0:0:0:0:
29+
51,192,1435,128,0,2141:0:0:0:0:
30+
51,192,2318,1,12,0:0:0:0:
31+
153,192,2318,1,4,0:0:0:0:
32+
256,192,2318,1,6,0:0:0:0:
33+
358,192,2318,1,14,0:0:0:0:
34+
460,192,2318,1,0,0:0:0:0:
35+
51,192,2494,128,0,2582:0:0:0:0:
36+
153,192,2494,128,14,2582:0:0:0:0:
37+
256,192,2494,128,6,2582:0:0:0:0:
38+
358,192,2494,128,4,2582:0:0:0:0:
39+
460,192,2494,128,12,2582:0:0:0:0:

osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs

+11-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,17 @@ private void handleControlPoints(TextWriter writer)
183183
if (scrollSpeedEncodedAsSliderVelocity)
184184
{
185185
foreach (var point in legacyControlPoints.EffectPoints)
186-
legacyControlPoints.Add(point.Time, new DifficultyControlPoint { SliderVelocity = point.ScrollSpeed });
186+
{
187+
legacyControlPoints.Add(point.Time, new DifficultyControlPoint
188+
{
189+
SliderVelocityBindable =
190+
{
191+
MinValue = point.ScrollSpeedBindable.MinValue,
192+
MaxValue = point.ScrollSpeedBindable.MaxValue,
193+
Value = point.ScrollSpeedBindable.Value,
194+
}
195+
});
196+
}
187197
}
188198

189199
LegacyControlPointProperties lastControlPointProperties = new LegacyControlPointProperties();

0 commit comments

Comments
 (0)