Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tomrus88 committed May 27, 2016
1 parent 6724501 commit b772f19
Show file tree
Hide file tree
Showing 2 changed files with 5,194 additions and 2 deletions.
6 changes: 4 additions & 2 deletions DBC Viewer/Readers/DB5Reader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ public void Save(DataTable table, Table def, string path)

var fields = def.Fields;
var fieldsCount = fields.Count;
var fieldsArraySizes = fields.Select(f => f.ArraySize).ToArray();

foreach (DataRow row in uniqueRows)
{
Expand All @@ -295,7 +296,7 @@ public void Save(DataTable table, Table def, string path)
continue;
}

int arraySize = fields[j].ArraySize;
int arraySize = fieldsArraySizes[j];

for (int k = 0; k < arraySize; k++)
{
Expand Down Expand Up @@ -404,10 +405,11 @@ public void Save(DataTable table, Table def, string path)

foreach (var copies in copyRows)
{
int keyIndex = copies.Key.Field<int>(IDColumn);
foreach (var copy in copies.Copies)
{
bw.Write(copy.Field<int>(IDColumn));
bw.Write(copies.Key.Field<int>(IDColumn));
bw.Write(keyIndex);
copyTableSize += 8;
}
}
Expand Down
Loading

0 comments on commit b772f19

Please sign in to comment.