Decompile fn_03506 (CActorNameCardHolder::Load)

Batch #13056 by Toshiro: 0 byte-identical, 1 confirmed by peer review.

- fn_03506 CActorNameCardHolder::Load: logic confirmed by peer review

Peer-reviewed-by: gordaoprogramas, cremane, codeplay
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-06 04:43:52 +00:00
commit 8ef4b90016

View file

@ -67,35 +67,38 @@ std::size_t CActorNameCardHolder::Load(const std::vector<char>& input) {
}
this->cards.clear();
const int count = *reinterpret_cast<const int*>(input.data());
int count;
std::memcpy(&count, input.data(), sizeof(count));
std::string text;
std::size_t offset = 4;
for (int index = 0; index < count; ++index) {
const std::uint32_t id = *reinterpret_cast<const std::uint32_t*>(&input[offset]);
std::uint32_t id;
std::memcpy(&id, input.data() + offset, sizeof(id));
this->cards[id].Reset();
int length = *reinterpret_cast<const int*>(&input[offset + 4]);
int length;
std::memcpy(&length, input.data() + offset + 4, sizeof(length));
offset += 8;
if (length > 0) {
this->cards[id].name.assign(&input[offset], length);
offset += length;
}
length = *reinterpret_cast<const int*>(&input[offset]);
std::memcpy(&length, input.data() + offset, sizeof(length));
offset += 4;
if (length > 0) {
this->cards[id].unknown_001C.assign(&input[offset], length);
offset += length;
}
length = *reinterpret_cast<const int*>(&input[offset]);
std::memcpy(&length, input.data() + offset, sizeof(length));
offset += 4;
if (length > 0) {
this->cards[id].unknown_0034.assign(&input[offset], length);
offset += length;
}
length = *reinterpret_cast<const int*>(&input[offset]);
std::memcpy(&length, input.data() + offset, sizeof(length));
offset += 4;
if (length > 0) {
this->cards[id].unknown_004C.assign(&input[offset], length);