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).
This commit is contained in:
ragnarok-clanker 2026-11-10 14:49:35 +00:00
commit 524fcf2959

View file

@ -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<int>(this->m_storage.size()), this->GetSize() + bytes);
std::vector<char> storage;
storage.resize(std::max(static_cast<int>(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;