Skip to content

Commit

Permalink
fix: parse 0x22 block length as unsigned int
Browse files Browse the repository at this point in the history
  • Loading branch information
PBug90 committed Mar 7, 2019
1 parent aeac5f9 commit 0a5bd4c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Binary file added replays/standard_1304.2on2.w3g
Binary file not shown.
2 changes: 1 addition & 1 deletion src/parsers/gamedata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const PlayerChatMessageBlock = new Parser()

// 0x22
const Unknown0x22 = new Parser()
.int8('length')
.uint8('length')
.string('content', { length: 'length' })

// 0x23
Expand Down
6 changes: 6 additions & 0 deletions test/replays.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,10 @@ describe('Replay parsing tests', () => {
expect(test.version).toBe('1.30.2+')
expect(test.players.length).toBe(2)
})

it('parses a standard 1.30.4 2on2 replay properly', () => {
const test = Parser.parse(`./replays/standard_1304.2on2.w3g`)
expect(test.version).toBe('1.30.2+')
expect(test.players.length).toBe(4)
})
})

0 comments on commit 0a5bd4c

Please sign in to comment.