Fix handling of combo offset without new combo, and incorrect lazer tests

This commit is contained in:
Dan Balasescu 2023-11-24 09:46:06 +09:00
parent 7bc2d6e6cd
commit 10e16e4b04
No known key found for this signature in database
4 changed files with 22 additions and 22 deletions

View File

@ -434,12 +434,12 @@ public void TestDecodeBeatmapComboOffsetsOsu()
new OsuBeatmapProcessor(converted).PreProcess(); new OsuBeatmapProcessor(converted).PreProcess();
new OsuBeatmapProcessor(converted).PostProcess(); new OsuBeatmapProcessor(converted).PostProcess();
Assert.AreEqual(4, ((IHasComboInformation)converted.HitObjects.ElementAt(0)).ComboIndexWithOffsets); Assert.AreEqual(1, ((IHasComboInformation)converted.HitObjects.ElementAt(0)).ComboIndexWithOffsets);
Assert.AreEqual(5, ((IHasComboInformation)converted.HitObjects.ElementAt(2)).ComboIndexWithOffsets); Assert.AreEqual(2, ((IHasComboInformation)converted.HitObjects.ElementAt(2)).ComboIndexWithOffsets);
Assert.AreEqual(5, ((IHasComboInformation)converted.HitObjects.ElementAt(4)).ComboIndexWithOffsets); Assert.AreEqual(3, ((IHasComboInformation)converted.HitObjects.ElementAt(4)).ComboIndexWithOffsets);
Assert.AreEqual(6, ((IHasComboInformation)converted.HitObjects.ElementAt(6)).ComboIndexWithOffsets); Assert.AreEqual(4, ((IHasComboInformation)converted.HitObjects.ElementAt(6)).ComboIndexWithOffsets);
Assert.AreEqual(11, ((IHasComboInformation)converted.HitObjects.ElementAt(8)).ComboIndexWithOffsets); Assert.AreEqual(8, ((IHasComboInformation)converted.HitObjects.ElementAt(8)).ComboIndexWithOffsets);
Assert.AreEqual(14, ((IHasComboInformation)converted.HitObjects.ElementAt(11)).ComboIndexWithOffsets); Assert.AreEqual(9, ((IHasComboInformation)converted.HitObjects.ElementAt(11)).ComboIndexWithOffsets);
} }
} }
@ -457,12 +457,12 @@ public void TestDecodeBeatmapComboOffsetsCatch()
new CatchBeatmapProcessor(converted).PreProcess(); new CatchBeatmapProcessor(converted).PreProcess();
new CatchBeatmapProcessor(converted).PostProcess(); new CatchBeatmapProcessor(converted).PostProcess();
Assert.AreEqual(4, ((IHasComboInformation)converted.HitObjects.ElementAt(0)).ComboIndexWithOffsets); Assert.AreEqual(1, ((IHasComboInformation)converted.HitObjects.ElementAt(0)).ComboIndexWithOffsets);
Assert.AreEqual(5, ((IHasComboInformation)converted.HitObjects.ElementAt(2)).ComboIndexWithOffsets); Assert.AreEqual(2, ((IHasComboInformation)converted.HitObjects.ElementAt(2)).ComboIndexWithOffsets);
Assert.AreEqual(5, ((IHasComboInformation)converted.HitObjects.ElementAt(4)).ComboIndexWithOffsets); Assert.AreEqual(3, ((IHasComboInformation)converted.HitObjects.ElementAt(4)).ComboIndexWithOffsets);
Assert.AreEqual(6, ((IHasComboInformation)converted.HitObjects.ElementAt(6)).ComboIndexWithOffsets); Assert.AreEqual(4, ((IHasComboInformation)converted.HitObjects.ElementAt(6)).ComboIndexWithOffsets);
Assert.AreEqual(11, ((IHasComboInformation)converted.HitObjects.ElementAt(8)).ComboIndexWithOffsets); Assert.AreEqual(8, ((IHasComboInformation)converted.HitObjects.ElementAt(8)).ComboIndexWithOffsets);
Assert.AreEqual(14, ((IHasComboInformation)converted.HitObjects.ElementAt(11)).ComboIndexWithOffsets); Assert.AreEqual(9, ((IHasComboInformation)converted.HitObjects.ElementAt(11)).ComboIndexWithOffsets);
} }
} }

View File

@ -3,30 +3,30 @@ osu file format v14
[HitObjects] [HitObjects]
// Circle with combo offset (3) // Circle with combo offset (3)
255,193,1000,49,0,0:0:0:0: 255,193,1000,49,0,0:0:0:0:
// Combo index = 4 // Combo index = 1
// Spinner with new combo followed by circle with no new combo // Spinner with new combo followed by circle with no new combo
256,192,2000,12,0,2000,0:0:0:0: 256,192,2000,12,0,2000,0:0:0:0:
255,193,3000,1,0,0:0:0:0: 255,193,3000,1,0,0:0:0:0:
// Combo index = 5 // Combo index = 2
// Spinner without new combo followed by circle with no new combo // Spinner without new combo followed by circle with no new combo
256,192,4000,8,0,5000,0:0:0:0: 256,192,4000,8,0,5000,0:0:0:0:
255,193,6000,1,0,0:0:0:0: 255,193,6000,1,0,0:0:0:0:
// Combo index = 5 // Combo index = 3
// Spinner without new combo followed by circle with new combo // Spinner without new combo followed by circle with new combo
256,192,7000,8,0,8000,0:0:0:0: 256,192,7000,8,0,8000,0:0:0:0:
255,193,9000,5,0,0:0:0:0: 255,193,9000,5,0,0:0:0:0:
// Combo index = 6 // Combo index = 4
// Spinner with new combo and offset (1) followed by circle with new combo and offset (3) // Spinner with new combo and offset (1) followed by circle with new combo and offset (3)
256,192,10000,28,0,11000,0:0:0:0: 256,192,10000,28,0,11000,0:0:0:0:
255,193,12000,53,0,0:0:0:0: 255,193,12000,53,0,0:0:0:0:
// Combo index = 11 // Combo index = 8
// Spinner with new combo and offset (2) followed by slider with no new combo followed by circle with no new combo // Spinner with new combo and offset (2) followed by slider with no new combo followed by circle with no new combo
256,192,13000,44,0,14000,0:0:0:0: 256,192,13000,44,0,14000,0:0:0:0:
256,192,15000,8,0,16000,0:0:0:0: 256,192,15000,8,0,16000,0:0:0:0:
255,193,17000,1,0,0:0:0:0: 255,193,17000,1,0,0:0:0:0:
// Combo index = 14 // Combo index = 9

View File

@ -27,7 +27,7 @@ protected override HitObject CreateHit(Vector2 position, bool newCombo, int comb
{ {
Position = position, Position = position,
NewCombo = FirstObject || lastObject is ConvertSpinner || newCombo, NewCombo = FirstObject || lastObject is ConvertSpinner || newCombo,
ComboOffset = comboOffset ComboOffset = newCombo ? comboOffset : 0
}; };
} }
@ -38,7 +38,7 @@ protected override HitObject CreateSlider(Vector2 position, bool newCombo, int c
{ {
Position = position, Position = position,
NewCombo = FirstObject || lastObject is ConvertSpinner || newCombo, NewCombo = FirstObject || lastObject is ConvertSpinner || newCombo,
ComboOffset = comboOffset, ComboOffset = newCombo ? comboOffset : 0,
Path = new SliderPath(controlPoints, length), Path = new SliderPath(controlPoints, length),
NodeSamples = nodeSamples, NodeSamples = nodeSamples,
RepeatCount = repeatCount RepeatCount = repeatCount

View File

@ -27,7 +27,7 @@ protected override HitObject CreateHit(Vector2 position, bool newCombo, int comb
{ {
Position = position, Position = position,
NewCombo = FirstObject || lastObject is ConvertSpinner || newCombo, NewCombo = FirstObject || lastObject is ConvertSpinner || newCombo,
ComboOffset = comboOffset ComboOffset = newCombo ? comboOffset : 0
}; };
} }
@ -38,7 +38,7 @@ protected override HitObject CreateSlider(Vector2 position, bool newCombo, int c
{ {
Position = position, Position = position,
NewCombo = FirstObject || lastObject is ConvertSpinner || newCombo, NewCombo = FirstObject || lastObject is ConvertSpinner || newCombo,
ComboOffset = comboOffset, ComboOffset = newCombo ? comboOffset : 0,
Path = new SliderPath(controlPoints, length), Path = new SliderPath(controlPoints, length),
NodeSamples = nodeSamples, NodeSamples = nodeSamples,
RepeatCount = repeatCount RepeatCount = repeatCount