From 50b431a92b2d8b34dd53122d59ac6b59a7507641 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 09:56:31 +0000 Subject: [PATCH] Decompile fn_19570 (CNavigationManager::CheckArrival) Batch #7464 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_19570 CNavigationManager::CheckArrival: logic confirmed by peer review Peer-reviewed-by: secret, meitogi, Toshiro Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/NavigationManager.h | 1 + Source/Contents/NavigationSource.cpp | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Source/Contents/NavigationManager.h b/Source/Contents/NavigationManager.h index baea96ea6..eeb5d7e7c 100644 --- a/Source/Contents/NavigationManager.h +++ b/Source/Contents/NavigationManager.h @@ -362,6 +362,7 @@ public: void SelectTarget(int nodeIndex); void CancelRoute(); void DrawRoute(const float* matrix); + void CheckArrival(int cellX, int cellY); /* 0000 */ CNaviData data; /* 004C */ CPathFinder pathFinder; diff --git a/Source/Contents/NavigationSource.cpp b/Source/Contents/NavigationSource.cpp index 504d4a93e..db416eeac 100644 --- a/Source/Contents/NavigationSource.cpp +++ b/Source/Contents/NavigationSource.cpp @@ -2,7 +2,7 @@ #include "Client/Session.h" #include "Resource/ResourceMgr.h" #include "Utility/Text/FormatString.h" - +#include "UI/Window/UINavigationWnd.h" #include #include #include @@ -805,3 +805,20 @@ void CNavigationManager::ResetCurrentTarget() { this->LoadTargetPreview(); this->ClearRouteNodes(); } + +// OFFSET: 0x00B94E90 +// FUNCTION: fn_19570 +void CNavigationManager::CheckArrival(int cellX, int cellY) { + if (this->unknown_1258 == 2) { + if (g_navigationWindow != nullptr) { + g_navigationWindow->Invalidate(); + } + if (this->unknown_115C) { + NaviCell cell; + this->data.GetCell(&cell); + if (std::abs(cell.x - cellX) <= 5 && std::abs(cell.y - cellY) <= 5) { + this->CancelRoute(); + } + } + } +}