From 286994a808b5dc684000b20bdaf76c2f2aebc20f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 11 Jan 2022 14:19:35 +0900 Subject: [PATCH] Fix `BeatmapDifficulty` cloning regression --- osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs | 3 +++ osu.Game/Beatmaps/BeatmapDifficulty.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs index 9b2e9fedc5..61f932fd98 100644 --- a/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -191,6 +191,9 @@ private bool shouldConvertSliderToHits(HitObject obj, IBeatmap beatmap, IHasDist protected override Beatmap CreateBeatmap() => new TaikoBeatmap(); + // Important to note that this is subclassing a realm object. + // Realm doesn't allow this, but for now this can work since we aren't (in theory?) persisting this to the database. + // It is only used during beatmap conversion and processing. internal class TaikoMultiplierAppliedDifficulty : BeatmapDifficulty { public TaikoMultiplierAppliedDifficulty(IBeatmapDifficultyInfo difficulty) diff --git a/osu.Game/Beatmaps/BeatmapDifficulty.cs b/osu.Game/Beatmaps/BeatmapDifficulty.cs index 90a60c0f0c..f6e8b8c57d 100644 --- a/osu.Game/Beatmaps/BeatmapDifficulty.cs +++ b/osu.Game/Beatmaps/BeatmapDifficulty.cs @@ -39,7 +39,7 @@ public BeatmapDifficulty(IBeatmapDifficultyInfo source) /// public BeatmapDifficulty Clone() { - var diff = new BeatmapDifficulty(); + var diff = (BeatmapDifficulty)MemberwiseClone(); CopyTo(diff); return diff; }