fixed packing structs (#6530)

* fixed packing structs in nested buffers

* fixed packing structs
This commit is contained in:
Kamil Rojewski
2021-03-25 18:25:00 +01:00
committed by GitHub
parent 3b7d1e86b4
commit 124654ffc4
4 changed files with 15 additions and 8 deletions

View File

@@ -1284,7 +1284,6 @@ constructor(
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
const pos = (this.pos !== null ? this.pos!.pack(builder) : 0);
const name = (this.name !== null ? builder.createString(this.name!) : 0);
const inventory = Monster.createInventoryVector(builder, this.inventory);
const test = builder.createObjectOffset(this.test);
@@ -1314,7 +1313,7 @@ pack(builder:flatbuffers.Builder): flatbuffers.Offset {
const scalarKeySortedTables = Monster.createScalarKeySortedTablesVector(builder, builder.createObjectOffsetList(this.scalarKeySortedTables));
Monster.startMonster(builder);
Monster.addPos(builder, pos);
Monster.addPos(builder, (this.pos !== null ? this.pos!.pack(builder) : 0));
Monster.addMana(builder, this.mana);
Monster.addHp(builder, this.hp);
Monster.addName(builder, name);