From dfadb24ce5a01714f8e270a26ecb9bec4fed7ce5 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 28 Oct 2026 17:38:51 +0000 Subject: [PATCH] Decompile 5 functions in Source/Contents/NavigationLink.cpp, Source/Contents/NavigationManager.h, ... Batch #1541 by ragnarok-clanker: 5 byte-identical, 0 confirmed by peer review. - fn_19473 CNavi_Link::GetTitle: byte-identical - fn_19475 CNavi_Link::GetName: byte-identical - fn_19487 CNavi_Link::GetIndex: byte-identical - fn_19492 CNavi_Link::GetType: byte-identical - fn_19494 CNavi_Link::GetId: byte-identical Merged automatically: every function is byte-identical to the original. Adds to the build: Source/Contents/NavigationLink.cpp --- Source/Contents/NavigationLink.cpp | 37 ++++++++++++++++++++++++ Source/Contents/NavigationManager.h | 41 +++++++++++++++++++++++++++ Source/Contents/NavigationRequest.cpp | 7 +++++ Source/Contents/NavigationSource.cpp | 32 +++++++++++++++++++++ data/compile.json | 1 + 5 files changed, 118 insertions(+) create mode 100644 Source/Contents/NavigationLink.cpp diff --git a/Source/Contents/NavigationLink.cpp b/Source/Contents/NavigationLink.cpp new file mode 100644 index 0000000..c9957dd --- /dev/null +++ b/Source/Contents/NavigationLink.cpp @@ -0,0 +1,37 @@ +#include "Contents/NavigationManager.h" + +// OFFSET: 0x00B8D8D0 + +// OFFSET: 0x00B8E5F0 +// FUNCTION: fn_19473 +const char* CNavi_Link::GetTitle() const { + return this->title.c_str(); +} + +// OFFSET: 0x00B8E610 +// FUNCTION: fn_19475 +const char* CNavi_Link::GetName() const { + return this->name.c_str(); +} + +// OFFSET: 0x00B8E7D0 + +// OFFSET: 0x00B8E830 +// FUNCTION: fn_19487 +int CNavi_Link::GetIndex() const { + return this->index; +} + +// OFFSET: 0x00B8E8A0 +// FUNCTION: fn_19492 +int CNavi_Link::GetType() const { + return this->type; +} + +// OFFSET: 0x00B8E8C0 +// FUNCTION: fn_19494 +int CNavi_Link::GetId() const { + return this->id; +} + +// OFFSET: 0x00B8E8F0 diff --git a/Source/Contents/NavigationManager.h b/Source/Contents/NavigationManager.h index 8c0d002..971117d 100644 --- a/Source/Contents/NavigationManager.h +++ b/Source/Contents/NavigationManager.h @@ -81,8 +81,29 @@ public: virtual CNaviInfo* GetInfo() const; }; +// VTABLE: vt_01778 +class CNavi_Link : public CNavi_Object { +public: + /* 007C */ CNaviInfo* linkedInfo; + /* 0080 */ int unknown_0080; + /* 0084 */ int unknown_0084; + /* 0088 */ int unknown_0088; + /* 008C */ std::vector linkedLinks; + + ~CNavi_Link() override; + int GetId() const override; + int GetType() const override; + int GetIndex() const override; + const char* GetName() const override; + const char* GetTitle() const override; + NaviCell* GetCell(NaviCell* out) const override; + CNaviInfo* GetInfo() const override; +}; + class CNaviInfo { public: + ~CNaviInfo(); + bool HasName(const char* name) const; const char* GetName() const; const char* GetTitle() const; @@ -100,6 +121,9 @@ public: }; struct NavigationTarget { + NavigationTarget() : type(-1), object(nullptr), x(-1), y(-1) {} + ~NavigationTarget(); + /* 0000 */ int type; /* 0004 */ void* object; /* 0008 */ int x; @@ -109,6 +133,10 @@ struct NavigationTarget { class CNaviData { public: + CNaviData(); + ~CNaviData(); + + bool SetDestination(CNaviInfo* info, int cellX, int cellY); CNaviInfo* GetInfo(); NaviCell* GetCell(NaviCell* out); void Clear(); @@ -126,6 +154,9 @@ public: class CNavigationManager { public: + CNavigationManager(); + ~CNavigationManager(); + NavigationTarget GetCurrentTarget() const; std::string GetCurrentTargetName() const; NavigationTarget GetSavedTarget() const; @@ -142,6 +173,11 @@ public: std::string DestinationTitle(); float FitToSquare(int* offsetX, int* offsetY, int width, int height, float size) const; void LoadSettings(); + void Reset(bool clearAll); + void ClearRouteNodes(); + void ClearNodePaths(); + CNaviInfo* GetLinkedPlayerInfo(); + bool UpdateGround(); /* 0000 */ CNaviData data; /* 004C */ CPathFinder pathFinder; @@ -189,7 +225,12 @@ public: /* 1344 */ int viewIcon; }; +extern CNavigationManager g_navigationManager; + #if defined(_WIN32) && !defined(_WIN64) +static_assert(sizeof(CNavi_Link) == 0x98); +static_assert(offsetof(CNavi_Link, linkedInfo) == 0x7C); +static_assert(offsetof(CNavi_Link, linkedLinks) == 0x8C); static_assert(sizeof(NaviCell) == 0x08); static_assert(sizeof(NaviDataEntry) == 0x0C); static_assert(sizeof(NaviRouteLine) == 0x2C); diff --git a/Source/Contents/NavigationRequest.cpp b/Source/Contents/NavigationRequest.cpp index 3d74aee..76a3aac 100644 --- a/Source/Contents/NavigationRequest.cpp +++ b/Source/Contents/NavigationRequest.cpp @@ -1,4 +1,7 @@ #include "Contents/NavigationManager.h" +#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/CGameMode.h" +#include "Contents/World/WorldScene.h" // OFFSET: 0x00B8DF10 // FUNCTION: fn_19461 @@ -64,3 +67,7 @@ int CNavi_Object::GetId() const { CNaviInfo* CNavi_Object::GetInfo() const { return this->info; } + +// OFFSET: 0x00B89940 + +// OFFSET: 0x00BA1260 diff --git a/Source/Contents/NavigationSource.cpp b/Source/Contents/NavigationSource.cpp index 493e6fb..4ef8fc6 100644 --- a/Source/Contents/NavigationSource.cpp +++ b/Source/Contents/NavigationSource.cpp @@ -1,8 +1,13 @@ #include "Contents/NavigationManager.h" +#include "Client/Session.h" #include "Resource/ResourceMgr.h" +#include #include +// GLOBAL: gl_24627 +CNavigationManager g_navigationManager; + // OFFSET: 0x00B96980 // FUNCTION: fn_19588 NavigationTarget CNavigationManager::GetCurrentTarget() const { @@ -102,3 +107,30 @@ int CNavigationManager::SaveCurrentTarget() { this->savedTarget = this->currentTarget; return 0; } + +// OFFSET: 0x00B880D0 + +// OFFSET: 0x00B88530 + +// OFFSET: 0x00B8CC10 + +// INLINED +NavigationTarget::~NavigationTarget() { + this->type = -1; + this->object = nullptr; + this->x = -1; + this->y = -1; + this->name.clear(); +} + +// OFFSET: 0x00B92580 + +// OFFSET: 0x00B92CA0 + +// OFFSET: 0x00B959D0 + +// OFFSET: 0x00B95A20 + +// OFFSET: 0x00B961A0 + +// OFFSET: 0x00B96BA0 diff --git a/data/compile.json b/data/compile.json index 133eaaa..40b2100 100644 --- a/data/compile.json +++ b/data/compile.json @@ -368,6 +368,7 @@ "Source/Contents/MovementRouteInterpolation.cpp": 4, "Source/Contents/Movies/BinkMovie.cpp": 3, "Source/Contents/Movies/BinkMovies.cpp": 3, + "Source/Contents/NavigationLink.cpp": 4, "Source/Contents/NavigationRequest.cpp": 4, "Source/Contents/NavigationRoute.cpp": 4, "Source/Contents/NavigationSource.cpp": 4,