From 7071d290f5993c3cfc9755563b65cf66c5d07faa Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 5 Nov 2026 10:56:13 +0000 Subject: [PATCH] Decompile fn_13615 (UIItemRepairWnd::SendMsg) Batch #12036 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_13615 UIItemRepairWnd::SendMsg: logic confirmed by peer review Peer-reviewed-by: KWDev, SapitoSucio, Toshiro Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Items/UIItemRepairWnd.cpp | 86 +++++++++++++++-------------- 1 file changed, 46 insertions(+), 40 deletions(-) diff --git a/Source/UI/Items/UIItemRepairWnd.cpp b/Source/UI/Items/UIItemRepairWnd.cpp index 822e5235..32f720ca 100644 --- a/Source/UI/Items/UIItemRepairWnd.cpp +++ b/Source/UI/Items/UIItemRepairWnd.cpp @@ -210,14 +210,37 @@ int UIItemRepairWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std ITEM_INFO item; switch (message) { + case 31: { + const UIItemRepairEntry& entry = *reinterpret_cast(a); + this->entries.push_back(entry); + this->itemIds.push_back(entry.itemId); + this->indices.push_back(entry.index); + + item.SetItemId(entry.itemId); + item.unknown_0060 = 0; + item.identified = 1; + this->m_list->AddLine(item.DisplayName(0).c_str()); + return 0; + } + + case 18: + this->m_list->SendMsg(nullptr, 18, 0, 0, 0, 0); + return 0; + + case 19: + this->m_list->SendMsg(nullptr, 19, 0, 0, 0, 0); + return 0; + case 6: { const int response = static_cast(a); this->RecordResponse(response, b, c, this->m_list->selected); - if (response == 184) { + switch (response) { + case 184: { if (g_replayAnimationScaling) { - this->m_list->selected = static_cast(d); - this->m_list->Invalidate(); + UIListBox* list = this->m_list; + list->selected = static_cast(d); + list->Invalidate(); } UIListBox* list = this->m_list; @@ -240,7 +263,10 @@ int UIItemRepairWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std g_windowMgr.CloseWindow(107); return 0; } - } else if (response == 185) { + break; + } + + case 185: g_modeMgr.gameMode->SendMsg(174, -1, 0, 0, 0); g_windowMgr.CloseWindow(107); return 0; @@ -249,52 +275,32 @@ int UIItemRepairWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std return 0; } - case 18: - this->m_list->SendMsg(nullptr, 18, 0, 0, 0, 0); - return 0; - - case 19: - this->m_list->SendMsg(nullptr, 19, 0, 0, 0, 0); - return 0; - - case 31: { - const UIItemRepairEntry& entry = *reinterpret_cast(a); - this->entries.push_back(entry); - this->itemIds.push_back(entry.itemId); - this->indices.push_back(entry.index); - - item.SetItemId(entry.itemId); - item.unknown_0060 = 0; - item.identified = 1; - this->m_list->AddLine(item.DisplayName(0).c_str()); - return 0; - } - case 123: { const auto* bytes = reinterpret_cast(a); - std::uint16_t marker; - std::memcpy(&marker, bytes, sizeof(marker)); + UIItemRepairRecordHeader header; unsigned offset = 6; + header = *reinterpret_cast(bytes); - if (marker == 22150) { + if (header.id == 22150) { while (static_cast(b) > offset) { - std::int16_t kind; - std::uint32_t size; - std::memcpy(&kind, bytes + offset, sizeof(kind)); - std::memcpy(&size, bytes + offset + 2, sizeof(size)); + header = *reinterpret_cast(bytes + offset); offset += 6; - if (kind == 22151) { + switch (header.id) { + case 22151: + return 0; + + case 22152: { + UIItemRepairEntry entry; + std::memcpy(&entry, bytes + offset, header.bytes); + offset += header.bytes; + this->SendMsg(nullptr, 31, reinterpret_cast(&entry), 0, 0, 0); break; } - if (kind == 22152) { - UIItemRepairEntry entry; - std::memcpy(&entry, bytes + offset, size); - offset += size; - this->SendMsg(nullptr, 31, reinterpret_cast(&entry), 0, 0, 0); - } else { - offset += size; + default: + offset += header.bytes; + break; } } }