Decompile fn_21645 (CGameMode::ReceiveItem1740AddOptions)

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

- fn_21645 CGameMode::ReceiveItem1740AddOptions: logic confirmed by peer review

Peer-reviewed-by: Yommy, dori, cremane
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-04 23:42:22 +00:00
commit bd6f220365

View file

@ -447,18 +447,18 @@ void CGameMode::ReceiveItem1740Add(const unsigned char* data) {
// OFFSET: 0x00D1FF70
// FUNCTION: fn_21645
void CGameMode::ReceiveItem1740AddOptions(const unsigned char* data) {
const ItemAddOptionsPacket packet = *reinterpret_cast<const ItemAddOptionsPacket*>(data);
const auto* packet = reinterpret_cast<const ItemAddOptionsPacket*>(data);
ItemRandomOption options[5];
std::memcpy(options, packet.options, sizeof(options));
std::memcpy(options, packet->options, sizeof(options));
ITEM_INFO item;
item.unknown_0000[1] = packet.index;
item.quantity = packet.amount;
item.SetItemId(packet.itemId);
item.identified = packet.identified;
item.unknown_005D = packet.damaged;
item.unknown_0060 = packet.refine;
item.unknown_0000[0] = packet.type;
std::memcpy(item.unknown_001C, packet.cards, sizeof(packet.cards));
item.unknown_0000[1] = packet->index;
item.quantity = packet->amount;
item.SetItemId(packet->itemId);
item.identified = packet->identified;
item.unknown_005D = packet->damaged;
item.unknown_0060 = packet->refine;
item.unknown_0000[0] = packet->type;
std::memcpy(item.unknown_001C, packet->cards, sizeof(packet->cards));
item.unknown_0098 = CountItemOptions(options);
for (int index = 0; index < item.unknown_0098; ++index) {
reinterpret_cast<ItemRandomOption*>(item.unknown_009C)[index] = options[index];