From 802685378884c176edbb8c5ab21ec7a80cc23656 Mon Sep 17 00:00:00 2001 From: minenice55 Date: Tue, 23 Aug 2022 09:19:17 -0400 Subject: [PATCH] fix entity duplication --- Assets/Scripts/BeatmapFormats/DynamicBeatmap.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/BeatmapFormats/DynamicBeatmap.cs b/Assets/Scripts/BeatmapFormats/DynamicBeatmap.cs index ddad957c..171e6c69 100644 --- a/Assets/Scripts/BeatmapFormats/DynamicBeatmap.cs +++ b/Assets/Scripts/BeatmapFormats/DynamicBeatmap.cs @@ -24,8 +24,10 @@ namespace HeavenStudio // software version (MajorMinorPatch, revision) {"productversion", 000}, {"productsubversion", 0}, - //file format version + // file format version {"riqversion", CurrentRiqVersion}, + // mapper set properties? (use this to flash the button) + {"propertiesmodified", false}, // general chart info {"remixtitle", "New Remix"}, // chart name @@ -89,8 +91,9 @@ namespace HeavenStudio public DynamicEntity DeepCopy() { - //lol the AI generated this - return JsonConvert.DeserializeObject(JsonConvert.SerializeObject(this)); + DynamicEntity copy = (DynamicEntity)this.MemberwiseClone(); + copy.DynamicData = new Dictionary(this.DynamicData); + return copy; } public dynamic this[string propertyName] @@ -166,11 +169,11 @@ namespace HeavenStudio } } - public object this[string propertyName] + public dynamic this[string propertyName] { get { - return properties[propertyName]; + return properties[propertyName] ?? null; } set {