From 54ac3292a9306615e935bb87ce8831140b419c99 Mon Sep 17 00:00:00 2001 From: Zachary Ross Date: Tue, 9 Jan 2024 11:28:59 -0500 Subject: [PATCH] Fix message retaining residual data This caused issues when extra data was added to a message upon being received --- RiptideNetworking/RiptideNetworking/Message.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/RiptideNetworking/RiptideNetworking/Message.cs b/RiptideNetworking/RiptideNetworking/Message.cs index a33972c5..f11dae5a 100644 --- a/RiptideNetworking/RiptideNetworking/Message.cs +++ b/RiptideNetworking/RiptideNetworking/Message.cs @@ -234,6 +234,7 @@ private Message Init(MessageHeader header) /// The message, ready to be used for handling. internal Message Init(byte firstByte, int contentLength, out MessageHeader header) { + data[contentLength / sizeof(ulong)] = 0; data[0] = firstByte; header = (MessageHeader)(firstByte & HeaderBitmask); SetHeader(header);