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(); + } + } + } +}