From add16eb4e5179ef2d49cbc9823c16e613cac1dfa Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Mon, 9 Nov 2026 18:55:46 +0000 Subject: [PATCH] Decompile fn_12704 (UIRoMapWnd::OnLBtnUp) Batch #15259 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_12704 UIRoMapWnd::OnLBtnUp: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, kyoshi Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Shortcuts/UIShortCutWnd.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/UI/Shortcuts/UIShortCutWnd.cpp b/Source/UI/Shortcuts/UIShortCutWnd.cpp index 86c38680f..c2eb6e28b 100644 --- a/Source/UI/Shortcuts/UIShortCutWnd.cpp +++ b/Source/UI/Shortcuts/UIShortCutWnd.cpp @@ -702,13 +702,15 @@ void UIRoMapWnd::OnLBtnUp(int x, int y) { menu->SendMsg(nullptr, UM_ADDITEM, reinterpret_cast(name->c_str()), 0, 0, 0); } - const int height = static_cast((std::min)(this->fieldNames.size() * 16, 160u)); + const int height = static_cast((std::min)(160u, this->fieldNames.size() * 16)); menu->SendMsg(nullptr, UM_SETCURITEM, 0, 0, 0, 0); menu->Resize(width, height); menu->SendMsg(nullptr, UM_SET_CALLER_WID, 140, 0, 0, 0); - const int menuY = this->geometry.height - (y + 1) - height >= 0 ? y + 1 : this->geometry.height - height; - const int menuX = this->geometry.width - (x + 2) - width >= 0 ? x + 2 : this->geometry.width - width; + const int below = y + 1; + const int right = x + 2; + const int menuY = this->geometry.height - below - height >= 0 ? below : this->geometry.height - height; + const int menuX = this->geometry.width - right - width >= 0 ? right : this->geometry.width - width; menu->Move(menuX, menuY); } } else if (this->selectedRecord) {