From 36c65d37b246bc3d4adefbefb4de6c3ecfbc98a9 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 6 Nov 2026 12:31:36 +0000 Subject: [PATCH] Decompile fn_03871 (UIChangeMaterialWnd_List::sub_5E1080) Batch #13179 by SapitoSucio: 0 byte-identical, 1 confirmed by peer review. - fn_03871 UIChangeMaterialWnd_List::sub_5E1080: logic confirmed by peer review Peer-reviewed-by: jessip, cremane, StrawberrysherbetIX Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/UIChangeMaterialWnd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/UI/UIChangeMaterialWnd.cpp b/Source/UI/UIChangeMaterialWnd.cpp index 12715dc5..43f18b95 100644 --- a/Source/UI/UIChangeMaterialWnd.cpp +++ b/Source/UI/UIChangeMaterialWnd.cpp @@ -95,11 +95,11 @@ void UIChangeMaterialWnd_List::sub_5E1080(int delta) { const int count = static_cast(this->m_items.size()); const int maxIndex = count - 1; + int targetIndex = static_cast(newIndex); if (newIndex >= static_cast(maxIndex)) { - newIndex = maxIndex; + targetIndex = maxIndex; } - int targetIndex = static_cast(newIndex); if (targetIndex < this->m_scrollOffset || targetIndex >= this->m_scrollOffset + this->m_pageSize) { int newOffset = this->m_previousScrollOffset; if (targetIndex < newOffset || targetIndex >= newOffset + this->m_pageSize) {