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).
This commit is contained in:
ragnarok-clanker 2026-11-10 10:10:06 +00:00
commit 5c9e616ab2

View file

@ -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<int>(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<std::intptr_t>(text.c_str()), 0xFF, 7, 0, 0);
g_windowMgr.SendNotice(UIM_PUSHINTOCHATHISTORY, reinterpret_cast<std::intptr_t>(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();