From e38b027ea15013b88f34a0688ca20bea8a4c2af4 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 28 Oct 2026 22:01:45 +0000 Subject: [PATCH] Decompile 2 functions in Source/Contents/NavigationSource.cpp, Source/Contents/NavigationManager.h Batch #1754 by Yommy: 2 byte-identical, 0 confirmed by peer review. - fn_19572 CNavigationManager::ClearCurrentObject: byte-identical - fn_19577 CNavigationManager::ClearNodes: byte-identical Merged automatically: every function is byte-identical to the original. --- Source/Contents/NavigationManager.h | 39 ++++++++++++++++++++++++++-- Source/Contents/NavigationSource.cpp | 33 +++++++++++++++++++++++ 2 files changed, 70 insertions(+), 2 deletions(-) diff --git a/Source/Contents/NavigationManager.h b/Source/Contents/NavigationManager.h index 13b8367..d7aeae9 100644 --- a/Source/Contents/NavigationManager.h +++ b/Source/Contents/NavigationManager.h @@ -36,6 +36,8 @@ struct NaviDataEntry { }; struct NaviRouteLine { + // OFFSET: 0x00B92F10 + /* 0000 */ int kind; /* 0004 */ int x; /* 0008 */ int y; @@ -110,6 +112,17 @@ public: CNaviInfo* GetInfo() const override; }; +#pragma pack(push, 1) +struct NaviObjectRecord { + /* 0000 */ int type; + /* 0004 */ int index; + /* 0008 */ int cellX; + /* 000C */ int cellY; + /* 0010 */ std::int16_t nameLength; + /* 0012 */ char name[1]; +}; +#pragma pack(pop) + class CNaviInfo { public: ~CNaviInfo(); @@ -144,12 +157,22 @@ public: struct NavigationTarget { NavigationTarget() : type(-1), object(nullptr), x(-1), y(-1) {} + + // INLINED + NavigationTarget(int type, void* object, int x, int y, std::string name) { + this->type = type; + this->object = object; + this->x = x; + this->y = y; + this->name = name; + } + ~NavigationTarget(); /* 0000 */ int type; /* 0004 */ void* object; - /* 0008 */ int x; - /* 000C */ int y; + /* 0008 */ int x = 0; + /* 000C */ int y = 0; /* 0010 */ std::string name; }; @@ -207,6 +230,17 @@ public: bool UpdateGround(); bool PlayerCell(int* column, int* row); bool LoadStates(std::vector packet); + bool AddState(const std::vector& tokens); + bool ParseFlags(const char* text, bool* first, bool* second, bool* third); + NaviCell ParseCell(const char* text); + std::vector WriteTarget(NavigationTarget target); + std::vector WriteObject(CNavi_Object* object); + void ClearSavedTarget(); + void ClearCurrentObject(); + void ClearStates(); + void ClearNodes(); + int FindNodePath(unsigned int index); + void SelectNodePath(std::string name); /* 0000 */ CNaviData data; /* 004C */ CPathFinder pathFinder; @@ -264,6 +298,7 @@ static_assert(offsetof(CNaviInfo, visited) == 0x40); static_assert(offsetof(NaviDataEntry, cost) == 0x08); static_assert(offsetof(CNavi_Link, linkedLinks) == 0x8C); static_assert(sizeof(NaviCell) == 0x08); +static_assert(offsetof(NaviObjectRecord, name) == 0x12); static_assert(sizeof(NaviDataEntry) == 0x0C); static_assert(sizeof(NaviRouteLine) == 0x2C); static_assert(offsetof(NaviRouteLine, text) == 0x0C); diff --git a/Source/Contents/NavigationSource.cpp b/Source/Contents/NavigationSource.cpp index 0a8490c..458110e 100644 --- a/Source/Contents/NavigationSource.cpp +++ b/Source/Contents/NavigationSource.cpp @@ -2,7 +2,9 @@ #include "Client/Session.h" #include "Resource/ResourceMgr.h" +#include #include +#include #include // GLOBAL: gl_24627 @@ -270,3 +272,34 @@ void CNavigationManager::Reset(bool clearAll) { this->unknown_12A4 = nullptr; this->ClearRouteNodes(); } + +// OFFSET: 0x00B93110 + +// OFFSET: 0x00B93670 + +// OFFSET: 0x00B938F0 + +// OFFSET: 0x00B94890 + +// OFFSET: 0x00B94B50 + +// OFFSET: 0x00B950B0 + +// OFFSET: 0x00B95260 +// FUNCTION: fn_19572 +void CNavigationManager::ClearCurrentObject() { + this->currentTarget.type = 0; + this->currentTarget.object = nullptr; +} + +// OFFSET: 0x00B95AD0 + +// OFFSET: 0x00B95AF0 +// FUNCTION: fn_19577 +void CNavigationManager::ClearNodes() { + this->nodes.clear(); +} + +// OFFSET: 0x00B95DC0 + +// OFFSET: 0x00B95FB0