From e0311aac48377ea139f37d958d624bf8a6139903 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 29 Oct 2026 08:58:36 +0000 Subject: [PATCH] Decompile fn_16918 (RunWindowAction) Batch #1984 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_16918 RunWindowAction: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker Reviewed-by: ragnarok-clanker --- Source/UI/Window/UIWindow.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Source/UI/Window/UIWindow.cpp b/Source/UI/Window/UIWindow.cpp index d450aef8..48add66e 100644 --- a/Source/UI/Window/UIWindow.cpp +++ b/Source/UI/Window/UIWindow.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -114,6 +115,17 @@ UIWindow::~UIWindow() { this->m_context->windowMgr.ForgetWindowReferences(this); } +// OFFSET: 0x00A79F80 +// FUNCTION: fn_16918 +bool RunWindowAction(bool primary, bool secondary, int value, int limit, std::function primaryAction, std::function secondaryAction) { + if (!primary && !secondary) { + return false; + } + + (primary && (!secondary || value <= limit) ? primaryAction : secondaryAction)(); + return true; +} + // INLINED UIWindow* UIWindow::Parent() const { return this->parent;