From 524fcf29596834537e5d6b156b2c730ad32df1c7 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 10 Nov 2026 14:49:35 +0000 Subject: [PATCH] Decompile fn_20424 (CPacketQueue::Prepend) Batch #16036 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_20424 CPacketQueue::Prepend: logic confirmed by peer review Peer-reviewed-by: gordaoprogramas, youko, kyoshi Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Network/Connection/PacketQueue.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Network/Connection/PacketQueue.cpp b/Source/Network/Connection/PacketQueue.cpp index 95b71f296..6183abe85 100644 --- a/Source/Network/Connection/PacketQueue.cpp +++ b/Source/Network/Connection/PacketQueue.cpp @@ -51,8 +51,9 @@ void CPacketQueue::InsertData(int bytes, const void* source) { // OFFSET: 0x00C7F160 // FUNCTION: fn_20424 void CPacketQueue::Prepend(int bytes, const void* source) { + const int size = std::max(static_cast(this->m_storage.size()), this->GetSize() + bytes); std::vector storage; - storage.resize(std::max(static_cast(this->m_storage.size()), this->GetSize() + bytes)); + storage.resize(size); std::memcpy(storage.data(), source, bytes); std::memcpy(storage.data() + bytes, this->m_data + this->m_read, this->GetSize()); this->m_write = this->GetSize() + bytes;