Skip to content

Commit

Permalink
Merge pull request #28 from wowdev/hotfix-fix
Browse files Browse the repository at this point in the history
Fix deletion hotfixes not applying
  • Loading branch information
Marlamin authored Sep 6, 2024
2 parents a82a1cd + 144e260 commit e652301
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions DBCD/DBCDStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ public DBCDStorage(DBParser parser, Storage<T> 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)
Expand All @@ -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);
}

Expand All @@ -182,6 +180,7 @@ IEnumerator<DynamicKeyValuePair<int>> IEnumerable<DynamicKeyValuePair<int>>.GetE

public void Save(string filename)
{
storage.Clear();
#if NETSTANDARD2_0
var sortedDictionary = new SortedDictionary<int, DBCDRow>(this);
foreach (var record in sortedDictionary)
Expand All @@ -191,10 +190,10 @@ public void Save(string filename)
storage.Add(id, record.AsType<T>());
#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
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<DebugType>embedded</DebugType>
<LangVersion>latest</LangVersion>
<Version>2.0.2</Version>
<Version>2.0.3</Version>
</PropertyGroup>
<PropertyGroup>
<Authors>WoWDev</Authors>
Expand Down

0 comments on commit e652301

Please sign in to comment.