Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3 from gavvvr/Patch-1
Browse files Browse the repository at this point in the history
Fixed TypeError issue
  • Loading branch information
icewind1991 authored Jan 31, 2017
2 parents ab7807c + 5f53426 commit ef776d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var ConsoleCmd = require('./consolecmd');
var StringTable = require('./stringtable');
var DataTable = require('./datatable');
var BitStream = require('bit-buffer').BitStream;
var BitView = require('bit-buffer').BitView;
var EventEmitter = require('events').EventEmitter;

var Parser = function (stream) {
Expand Down Expand Up @@ -118,7 +119,7 @@ Parser.prototype.readMessage = function (stream) {

length = stream.readInt32();
start = stream.byteIndex;
buffer = stream.buffer.slice(start, start + length);
buffer = new BitView(stream.view.buffer.slice(start, start + length));
stream.byteIndex += length;
return this.parseMessage(buffer, type, tick, length);
};
Expand Down

0 comments on commit ef776d6

Please sign in to comment.