Decompile fn_16628 (CUIRenewQuestUI::SelectQuest)

Batch #17076 by eAthena: 0 byte-identical, 1 confirmed by peer review.

- fn_16628 CUIRenewQuestUI::SelectQuest: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, Yommy, Toshiro
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-11 13:21:21 +00:00
commit 133484deff

View file

@ -1037,27 +1037,26 @@ void CUIRenewQuestUI::OnCallback56() {
void CUIRenewQuestUI::SelectQuest(unsigned int questId) {
for (RenewQuestUI::CUIQuestList* list : this->questLists) {
CUIListBoxEx<RenewQuestUI::CUIQuestItem, unsigned long>* listBox = list->list;
for (auto node = listBox->data.begin(); node != listBox->data.end(); ++node) {
if (*node == questId) {
this->tab->SelectPage(list);
CUIListBoxEx<RenewQuestUI::CUIQuestItem, unsigned long>* pageListBox = list->list;
auto node = std::find(listBox->data.begin(), listBox->data.end(), questId);
if (node != listBox->data.end()) {
this->tab->SelectPage(list);
CUIListBoxEx<RenewQuestUI::CUIQuestItem, unsigned long>* pageListBox = list->list;
int index = 0;
for (auto it = listBox->data.begin(); it != node; ++it) {
++index;
}
pageListBox->scrollBar->SetPosition(pageListBox->rowHeight * index);
for (RenewQuestUI::CUIQuestItem* item : pageListBox->items) {
if (item->index == index) {
pageListBox->SelectItem(item);
return;
}
}
return;
int index = 0;
for (auto it = listBox->data.begin(); it != node; ++it) {
++index;
}
pageListBox->scrollBar->SetPosition(pageListBox->rowHeight * index);
for (RenewQuestUI::CUIQuestItem* item : pageListBox->items) {
if (index == item->index) {
pageListBox->SelectItem(item);
return;
}
}
return;
}
}