From 24bd8692f1db6fde685bb4bf65aadd06a14b43ba Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 13:20:50 +0000 Subject: [PATCH] Decompile fn_21850 (CGameMode::ReceiveVendingItemSoldNow) Batch #7981 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_21850 CGameMode::ReceiveVendingItemSoldNow: logic confirmed by peer review Peer-reviewed-by: Yommy, pedrao Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Client/Mode/CGameMode.h | 2 ++ Source/Client/Mode/GameModeNotices.cpp | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/Source/Client/Mode/CGameMode.h b/Source/Client/Mode/CGameMode.h index 1d114c61..264b944b 100644 --- a/Source/Client/Mode/CGameMode.h +++ b/Source/Client/Mode/CGameMode.h @@ -588,10 +588,12 @@ public: void ReceiveTypedItemList(const unsigned char* packet); void ReceiveVendingItemList(int aid, int storeId, char own, int count, std::uint32_t duration, const unsigned char* data, int value, int unused); void ReceiveVendingItemList2(int aid, int storeId, char own, int count, std::uint32_t duration, const unsigned char* data); + void ReceiveVendingItemSoldNow(const unsigned char* data); }; void LaunchRollingCutterEffect(CGameActor* actor); void __stdcall sub_CDBC30(const vector3d* position, int actorId, float scale, int job); +void __stdcall sub_D08670(int field14, int itemId, int quantity, int field8, int fieldC, int field10); #if defined(_WIN32) && !defined(_WIN64) static_assert(offsetof(CGameMode, mapName) == 0x68); diff --git a/Source/Client/Mode/GameModeNotices.cpp b/Source/Client/Mode/GameModeNotices.cpp index 3305f826..6ea8574c 100644 --- a/Source/Client/Mode/GameModeNotices.cpp +++ b/Source/Client/Mode/GameModeNotices.cpp @@ -3067,6 +3067,15 @@ static void FillVendingItem(ITEM_INFO& item, const VendingItemRecord2& record) { item.unknown_0070 = record.sprite; } +// OFFSET: 0x00D47720 +// FUNCTION: fn_21850 +void CGameMode::ReceiveVendingItemSoldNow(const unsigned char* data) { + const int itemId = *reinterpret_cast(data + 2); + const short quantity = *reinterpret_cast(data + 6); + const int field8 = *reinterpret_cast(data + 8); + sub_D08670(static_cast(_time32(nullptr)), itemId, quantity, field8, 0, 0); +} + // OFFSET: 0x00D70790 // OFFSET: 0x00D6C410