diff --git a/DBCD/DBCDStorage.cs b/DBCD/DBCDStorage.cs index 5f185e5..253d362 100644 --- a/DBCD/DBCDStorage.cs +++ b/DBCD/DBCDStorage.cs @@ -144,8 +144,6 @@ public DBCDStorage(DBParser parser, Storage storage, DBCDInfo info) : base(ne foreach (var record in storage) base.Add(record.Key, new DBCDRow(record.Key, record.Value, fieldAccessor)); - - storage.Clear(); } public void ApplyingHotfixes(HotfixReader hotfixReader) @@ -166,7 +164,7 @@ public void ApplyingHotfixes(HotfixReader hotfixReader, HotfixReader.RowProcesso foreach (var (id, row) in mutableStorage) base[id] = new DBCDRow(id, row, fieldAccessor); #endif - foreach (var key in mutableStorage.Keys.Except(base.Keys)) + foreach (var key in base.Keys.Except(mutableStorage.Keys)) base.Remove(key); } @@ -182,6 +180,7 @@ IEnumerator> IEnumerable>.GetE public void Save(string filename) { + storage.Clear(); #if NETSTANDARD2_0 var sortedDictionary = new SortedDictionary(this); foreach (var record in sortedDictionary) @@ -191,10 +190,10 @@ public void Save(string filename) storage.Add(id, record.AsType()); #endif storage.Save(filename); - storage.Clear(); } - public DBCDRow ConstructRow(int index) { + public DBCDRow ConstructRow(int index) + { T raw = new(); var fields = typeof(T).GetFields(); // Array Fields need to be initialized to fill their length diff --git a/Directory.Build.props b/Directory.Build.props index a2421d6..469bb45 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ embedded latest - 2.0.2 + 2.0.3 WoWDev