1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 23:12:56 +08:00

Ensure detached when performing model Clone operations on BeatmapInfo/ScoreInfo

This commit is contained in:
Dean Herbert 2022-01-14 13:08:20 +09:00
parent 54804ebfbd
commit 9b33fbbee5
2 changed files with 2 additions and 2 deletions

View File

@ -185,7 +185,7 @@ namespace osu.Game.Beatmaps
public int BeatmapVersion; public int BeatmapVersion;
public BeatmapInfo Clone() => (BeatmapInfo)MemberwiseClone(); public BeatmapInfo Clone() => (BeatmapInfo)this.Detach().MemberwiseClone();
public override string ToString() => this.GetDisplayTitle(); public override string ToString() => this.GetDisplayTitle();

View File

@ -131,7 +131,7 @@ namespace osu.Game.Scoring
public ScoreInfo DeepClone() public ScoreInfo DeepClone()
{ {
var clone = (ScoreInfo)MemberwiseClone(); var clone = (ScoreInfo)this.Detach().MemberwiseClone();
clone.Statistics = new Dictionary<HitResult, int>(clone.Statistics); clone.Statistics = new Dictionary<HitResult, int>(clone.Statistics);