rodecomp/Source/UI/Shortcuts/ShortcutActivation.cpp
ragnarok-clanker 3a59e4d665 Decompile fn_12689 (UIShortCutWnd::Slot26)
Batch #13347 by aDw: 0 byte-identical, 1 confirmed by peer review.

- fn_12689 UIShortCutWnd::Slot26: logic confirmed by peer review

Peer-reviewed-by: gordaoprogramas, Tanke, cremane
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-11-06 13:45:49 +00:00

29 lines
1,007 B
C++

#include "Client/Session.h"
#include "Contents/Skills/AutomaticSkills.h"
#include "UI/Shortcuts/ShortcutActivation.h"
#include "UI/Shortcuts/UIShortCutWnd.h"
#include "UI/Window/UIWindow.h"
// OFFSET: 0x00930900
// FUNCTION: fn_12689
void UIShortCutWnd::Slot26(int x, int y) {
const int column = this->m_grid.HitTest(x, y, g_session.ItemSlotActive(), g_session.m_hotkeyPage);
if (column == -1) {
return;
}
const unsigned index = 9u * g_session.m_hotkeyPage + static_cast<unsigned>(column);
const int limit = 9 * this->m_grid.rows;
if (limit <= static_cast<int>(index)) {
return;
}
const NormalItemSlot& slot = *this->m_slots[index];
if (slot.unknown_0000 != 0 && g_session.m_automaticSkills.Contains(static_cast<std::uint16_t>(slot.itemId))) {
g_session.SetOption(AutomaticSkills::CancelOption(static_cast<std::int16_t>(slot.itemId)), 1, 0);
} else {
g_session.m_automaticSkills.DisableAll();
}
this->SendMsg(nullptr, 41, column, g_session.m_hotkeyPage, 0, 0);
}