diff --git a/src/packets/BasePacket.js b/src/packets/BasePacket.js index 6fbe819..2222408 100644 --- a/src/packets/BasePacket.js +++ b/src/packets/BasePacket.js @@ -29,8 +29,10 @@ class BasePacket { let packet = Buffer.alloc(size+1); let offset = 0; - packet.writeUInt8(this.id, offset); - offset+=1; + if (typeof this.id == "undefined") { + packet.writeUInt8(this.id, offset); + offset+=1; + } for (let v in this.fields){ this.fields[v].write(packet, this.fields[v].value, offset);