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).
This commit is contained in:
ragnarok-clanker 2026-11-06 12:31:36 +00:00
commit 36c65d37b2

View file

@ -95,11 +95,11 @@ void UIChangeMaterialWnd_List::sub_5E1080(int delta) {
const int count = static_cast<int>(this->m_items.size());
const int maxIndex = count - 1;
int targetIndex = static_cast<int>(newIndex);
if (newIndex >= static_cast<uint32_t>(maxIndex)) {
newIndex = maxIndex;
targetIndex = maxIndex;
}
int targetIndex = static_cast<int>(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) {