Skip to content

Commit

Permalink
Add case for legacy DataMapping
Browse files Browse the repository at this point in the history
  • Loading branch information
InX-Invader authored Mar 17, 2021
1 parent d1c4912 commit 1bdd1d5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/unforge/ComplexTypes/DataForgeDataMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ public class DataForgeDataMapping : _DataForgeSerializable
public DataForgeDataMapping(DataForge documentRoot)
: base(documentRoot)
{
this.StructCount = this._br.ReadUInt32();
this.StructIndex = this._br.ReadUInt32();
if(this.DocumentRoot.FileVersion >= 5) {
this.StructCount = this._br.ReadUInt32();
this.StructIndex = this._br.ReadUInt32();
} else {
this.StructCount = this._br.ReadUInt16();
this.StructIndex = this._br.ReadUInt16();
}
this.NameOffset = documentRoot.StructDefinitionTable[this.StructIndex].NameOffset;
}

Expand Down

0 comments on commit 1bdd1d5

Please sign in to comment.