From 65b02eb4c206632791184e2f72f757b54ae62c5c Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 18:58:00 +0000 Subject: [PATCH] Decompile 3 functions in Source/Contents/NavigationSource.cpp, Source/Contents/NavigationManager.h Batch #8551 by youko: 0 byte-identical, 3 confirmed by peer review. - fn_19626 CNavigationManager::BuildNodePaths: logic confirmed by peer review - fn_19627 CNavigationManager::BuildSingleNodePaths: logic confirmed by peer review - fn_19575 CNavigationManager::ClearNodePaths: logic confirmed by peer review Peer-reviewed-by: Yommy, SapitoSucio Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/NavigationManager.h | 2 ++ Source/Contents/NavigationSource.cpp | 48 +++++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/Source/Contents/NavigationManager.h b/Source/Contents/NavigationManager.h index 53765261..c69a3eca 100644 --- a/Source/Contents/NavigationManager.h +++ b/Source/Contents/NavigationManager.h @@ -324,6 +324,8 @@ public: void Reset(bool clearAll); void ClearRouteNodes(); void ClearNodePaths(); + void BuildNodePaths(); + void BuildSingleNodePaths(); CNaviInfo* GetLinkedPlayerInfo(); bool CollectStartLinks(); bool UpdateGround(); diff --git a/Source/Contents/NavigationSource.cpp b/Source/Contents/NavigationSource.cpp index fa322eef..6b2b06e4 100644 --- a/Source/Contents/NavigationSource.cpp +++ b/Source/Contents/NavigationSource.cpp @@ -256,7 +256,7 @@ void CNavigationManager::ClearNodePaths() { for (std::size_t i = 0; i < this->nodePaths.size(); ++i) { this->nodePaths[i].clear(); } - this->nodePaths.clear(); + this->nodePaths.erase(this->nodePaths.begin(), this->nodePaths.end()); } // OFFSET: 0x00B961A0 @@ -974,3 +974,49 @@ void CNavigationManager::CheckArrival(int cellX, int cellY) { } } } + +// OFFSET: 0x00B9DE60 +// FUNCTION: fn_19626 +void CNavigationManager::BuildNodePaths() { + this->ClearNodePaths(); + + if (this->unknown_1260 == 0 || this->unknown_1260 == 1) { + for (int index = 0; index < this->states.size(); ++index) { + if (this->states[index].type == 1) { + std::vector path; + path.push_back(index); + this->nodePaths.push_back(path); + } + } + } + + for (int index = 0; index < this->states.size(); ++index) { + if (this->unknown_1260 != 0 && this->states[index].type != this->unknown_1260) { + continue; + } + if (this->states[index].type == 1) { + continue; + } + + const int path = this->FindNodePath(index); + if (path == -1) { + std::vector single; + single.push_back(index); + this->nodePaths.push_back(single); + } else { + this->nodePaths[path].push_back(index); + } + } +} + +// OFFSET: 0x00B9E140 +// FUNCTION: fn_19627 +void CNavigationManager::BuildSingleNodePaths() { + this->ClearNodePaths(); + + for (int index = 0; index < this->states.size(); ++index) { + std::vector path; + path.push_back(index); + this->nodePaths.push_back(path); + } +}