From 9d3e6d1668467aa0e5fb94abffdb9515e9a0ad84 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 28 Oct 2026 12:13:49 +0000 Subject: [PATCH] Decompile 2 functions in Source/Contents/NavigationSource.cpp, Source/Contents/NavigationManager.h Batch #1395 by Yommy: 2 byte-identical, 0 confirmed by peer review. - fn_19597 NavigationManager::GetCurrentTargetType: byte-identical - fn_19635 NavigationManager::SaveCurrentTarget: byte-identical Merged automatically: every function is byte-identical to the original. Adds to the build: Source/Contents/NavigationSource.cpp --- Source/Contents/NavigationManager.h | 33 ++++++++++++++++++++++++++++ Source/Contents/NavigationSource.cpp | 25 +++++++++++++++++++++ data/compile.json | 1 + 3 files changed, 59 insertions(+) create mode 100644 Source/Contents/NavigationManager.h create mode 100644 Source/Contents/NavigationSource.cpp diff --git a/Source/Contents/NavigationManager.h b/Source/Contents/NavigationManager.h new file mode 100644 index 0000000..4eceb3d --- /dev/null +++ b/Source/Contents/NavigationManager.h @@ -0,0 +1,33 @@ +#ifndef RAGNAROK_SOURCE_CONTENTS_NAVIGATIONMANAGER_H +#define RAGNAROK_SOURCE_CONTENTS_NAVIGATIONMANAGER_H + +#include +#include + +class NavigationObject; + +struct NavigationTarget { + /* 0000 */ int type; + /* 0004 */ NavigationObject* object; + /* 0008 */ int x; + /* 000C */ int y; + /* 0010 */ std::string name; +}; + +class NavigationManager { +public: + NavigationTarget GetCurrentTarget() const; + NavigationTarget GetSavedTarget() const; + int GetCurrentTargetType() const; + int SaveCurrentTarget(); + + /* 0000 */ unsigned char unknown_0000[0x10FC]; + /* 10FC */ NavigationTarget currentTarget; + /* 1124 */ NavigationTarget savedTarget; +}; + +#if defined(_WIN32) && !defined(_WIN64) +static_assert(offsetof(NavigationManager, savedTarget) == 0x1124); +#endif + +#endif diff --git a/Source/Contents/NavigationSource.cpp b/Source/Contents/NavigationSource.cpp new file mode 100644 index 0000000..541a7ad --- /dev/null +++ b/Source/Contents/NavigationSource.cpp @@ -0,0 +1,25 @@ +#include "Contents/NavigationManager.h" + +// OFFSET: 0x00B96980 + +// OFFSET: 0x00B96AE0 + +// OFFSET: 0x00B971D0 +// FUNCTION: fn_19597 +int NavigationManager::GetCurrentTargetType() const { + return this->currentTarget.type; +} + +// OFFSET: 0x00BA0AE0 +// FUNCTION: fn_19635 +int NavigationManager::SaveCurrentTarget() { + const int type = this->currentTarget.type; + if (type == 6) { + return -92; + } + if ((type != 1 && type != 2 && type != 3 && type != 0) || !this->currentTarget.object) { + return -97; + } + this->savedTarget = this->currentTarget; + return 0; +} diff --git a/data/compile.json b/data/compile.json index a913527..38519e2 100644 --- a/data/compile.json +++ b/data/compile.json @@ -364,6 +364,7 @@ "Source/Contents/MovementRouteInterpolation.cpp": 4, "Source/Contents/Movies/BinkMovie.cpp": 3, "Source/Contents/Movies/BinkMovies.cpp": 3, + "Source/Contents/NavigationSource.cpp": 4, "Source/Contents/Party/AdvenPartyInfo.cpp": 4, "Source/Contents/Party/AdventurerAgencyMgr.cpp": 4, "Source/Contents/Party/AgencyRequests.cpp": 4,