Decompile fn_19620 (CNavigationManager::UpdateSearchResults)

Batch #8461 by alisonrag: 0 byte-identical, 1 confirmed by peer review.

- fn_19620 CNavigationManager::UpdateSearchResults: logic confirmed by peer review

Peer-reviewed-by: Yommy, dori
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-10-31 18:04:40 +00:00
commit c348afbe7b
2 changed files with 39 additions and 0 deletions

View file

@ -22,6 +22,7 @@
#include "Utility/RegistryKey.h"
#include <cstdint>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
@ -1024,6 +1025,43 @@ void CNavigationManager::RefreshSearch() {
}
}
// OFFSET: 0x00B9C5C0
// FUNCTION: fn_19620
bool CNavigationManager::UpdateSearchResults() {
this->unknown_125C = 0;
if (!this->data.Search(this->unknown_1264, 0, this->states)) {
return false;
}
std::sort(this->states.begin(), this->states.end(), [](const NavigationTarget& left, const NavigationTarget& right) { return left > right; });
this->ClearNodePaths();
if (this->unknown_1260 == 0 || this->unknown_1260 == 1) {
for (unsigned index = 0; index < this->states.size(); ++index) {
if (this->states[index].type == 1) {
this->nodePaths.push_back(std::vector<int>(1, static_cast<int>(index)));
}
}
}
for (unsigned index = 0; index < this->states.size(); ++index) {
const int type = this->states[index].type;
if ((this->unknown_1260 != 0 && type != this->unknown_1260) || type == 1) {
continue;
}
const int path = this->FindNodePath(index);
if (path == -1) {
this->nodePaths.push_back(std::vector<int>(1, static_cast<int>(index)));
} else {
this->nodePaths[path].push_back(static_cast<int>(index));
}
}
this->SelectNodePath(this->unknown_1264);
return true;
}
// OFFSET: 0x00B9C740
// FUNCTION: fn_19623
int CNavigationManager::AddWrappedRouteLines(int kind, int x, int y, const char* text) {