From c62a2808a0dce411f443d3fc80229006afd57bd1 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 10 Nov 2026 14:24:38 +0000 Subject: [PATCH] Decompile 2 functions in Source/Contents/NavigationRequest.cpp Batch #15911 by eAthena: 0 byte-identical, 2 confirmed by peer review. - fn_19420 FindNaviObjectByName: logic confirmed by peer review - fn_19598 CNavigationManager::RequestRoute: logic confirmed by peer review Peer-reviewed-by: Yommy, alisonrag, Toshiro Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/NavigationRequest.cpp | 29 ++++++++++++++------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Source/Contents/NavigationRequest.cpp b/Source/Contents/NavigationRequest.cpp index 576c5cc02..bcc5c9d21 100644 --- a/Source/Contents/NavigationRequest.cpp +++ b/Source/Contents/NavigationRequest.cpp @@ -14,8 +14,9 @@ // FUNCTION: fn_19420 __declspec(noinline) CNavi_Object* FindNaviObjectByName(const char* name, const std::vector& objects) { for (std::vector::const_iterator it = objects.begin(); it != objects.end(); ++it) { + const CNavi_Object* object = *it; if (name) { - if ((*it)->name == std::string(name)) { + if (object->name == std::string(name)) { return *it; } } @@ -215,20 +216,20 @@ int CNavigationManager::RequestRoute(int cellX, int cellY) { int startX = 0; int startY = 0; CGameMode* mode = static_cast(g_modeMgr.GetGameMode()); - if (mode == nullptr) { - return -95; + if (mode != nullptr) { + mode->PlayerCell(&startX, &startY); + this->UpdateGround(); + if (!this->BuildRoute(startX, startY, destX, destY, false)) { + return -99; + } + this->data.SetDestination(target, destX, destY); + this->drawRoute = true; + this->routeFlag = true; + this->drawDestination = true; + this->viewMode = 2; + return 9; } - mode->PlayerCell(&startX, &startY); - this->UpdateGround(); - if (!this->BuildRoute(startX, startY, destX, destY, false)) { - return -99; - } - this->data.SetDestination(target, destX, destY); - this->drawRoute = true; - this->routeFlag = true; - this->drawDestination = true; - this->viewMode = 2; - return 9; + return -95; } // OFFSET: 0x00B8E350