From 5c9e616ab22aeda6876ea4ba738d92b18cbb5988 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 10 Nov 2026 10:10:06 +0000 Subject: [PATCH] Decompile 2 functions in Source/Client/SessionState.cpp Batch #15536 by Yommy: 0 byte-identical, 2 confirmed by peer review. - fn_24192 CSession::UnequipSwapEquippedItem: logic confirmed by peer review - fn_24193 CSession::UnequipSwapCostumeItem: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, eAthena Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Client/SessionState.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Client/SessionState.cpp b/Source/Client/SessionState.cpp index 3566e0b36..d0f99fa58 100644 --- a/Source/Client/SessionState.cpp +++ b/Source/Client/SessionState.cpp @@ -236,8 +236,9 @@ void CSession::UnequipSwapEquippedItem(const ITEM_INFO& item) { const EquipSlots slots = g_session.GetEquipSlots(location); if (slots.values[2] < 10) { if (slots.values[2] != -1) { - this->swapEquippedItems[slots.values[2]].identity[3] = 0; - this->swapEquippedItems[slots.values[2]].Reset(); + ITEM_INFO& entry = this->swapEquippedItems[slots.values[2]]; + entry.identity[3] = 0; + entry.Reset(); } if (slots.values[1] != -1 && slots.values[1] < 10) { this->swapEquippedItems[slots.values[1]].Reset(); @@ -260,19 +261,18 @@ void CSession::UnequipSwapCostumeItem(const ITEM_INFO& item) { const int location = static_cast(item.identity[3]); if (location == 0x8000) { ITEM_INFO equipped = g_session.FindItemByIdentity(item.identity[1], location); - if (equipped.identity[1] != 0) { + if (equipped.identity[1] > 0) { const char* message = LookupMessage(MSI_ITEM_IS_REMOVED); - const std::string name = equipped.DisplayName(0); - const std::string text = FormatOwnedString("%s%s", name.c_str(), message); - g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(text.c_str()), 0xFF, 7, 0, 0); + g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast(FormatOwnedString("%s%s", equipped.DisplayName(0).c_str(), message).c_str()), 0xFF, 7, 0, 0); } this->SetSwapArrowIndex(0); } else { const EquipSlots slots = g_session.GetEquipSlots(location); if (slots.values[2] < 10) { if (slots.values[2] != -1) { - this->swapCostumeItems[slots.values[2]].identity[3] = 0; - this->swapCostumeItems[slots.values[2]].Reset(); + ITEM_INFO& entry = this->swapCostumeItems[slots.values[2]]; + entry.identity[3] = 0; + entry.Reset(); } if (slots.values[1] != -1 && slots.values[1] < 10) { this->swapCostumeItems[slots.values[1]].Reset();