diff --git a/osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs b/osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs index 3b0bfe613d..5f806837f2 100644 --- a/osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs @@ -220,18 +220,13 @@ namespace osu.Game.Beatmaps.Formats var samplePoint = legacyControlPoints.SamplePointAt(group.Time); var effectPoint = legacyControlPoints.EffectPointAt(group.Time); - // if samplePoint isn't already legacy,create LegacyHitSampleInfo with customSampleBank 1 - HitSampleInfo tempHitSample; - - if (samplePoint.GetType() == typeof(SampleControlPoint)) - { - tempHitSample = samplePoint.ApplyTo(new ConvertHitObjectParser.LegacyHitSampleInfo(string.Empty, customSampleBank: 1)); - } + // if samplePoint isn't already legacy, create LegacyHitSampleInfo with customSampleBank 1 // else create LegacyHitSampleInfo with existing customSampleBank - else - { - tempHitSample = samplePoint.ApplyTo(new ConvertHitObjectParser.LegacyHitSampleInfo(string.Empty)); - } + HitSampleInfo tempHitSample = samplePoint.ApplyTo( + samplePoint.GetType() == typeof(SampleControlPoint) + ? new ConvertHitObjectParser.LegacyHitSampleInfo(string.Empty, customSampleBank: 1) + : new ConvertHitObjectParser.LegacyHitSampleInfo(string.Empty) + ); // Apply the control point to a hit sample to uncover legacy properties (e.g. suffix) int customSampleBank = toLegacyCustomSampleBank(tempHitSample);