From 1569b7aacd904df333c7f6f9f91cec7b05d47f48 Mon Sep 17 00:00:00 2001 From: DryByte <93609026+DryByte@users.noreply.github.com> Date: Fri, 18 Oct 2024 07:07:25 -0300 Subject: [PATCH] Allow id less packets exist --- src/packets/BasePacket.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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);